<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;">You're getting ahead of me again.<br><br>Michael<br><br>--- On <b>Sun, 4/12/09, Jake McArthur <i>&lt;jake.mcarthur@gmail.com&gt;</i></b> wrote:<br><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"><br>From: Jake McArthur &lt;jake.mcarthur@gmail.com&gt;<br>Subject: Re: [Haskell-cafe] Functions that return functions<br>To: "michael rice" &lt;nowgate@yahoo.com&gt;<br>Cc: haskell-cafe@haskell.org<br>Date: Sunday, April 12, 2009, 5:45 PM<br><br><div class="plainMail">michael rice wrote:<br>&gt; Admittedly, functions that return functions are Lispy, but perhaps there a Haskelly way to accomplish the same thing?<br><br>Actually, I think you will come to find that this way of thinking is more Haskelly than it is Lispy!<br><br>&nbsp; &nbsp; import Control.Applicative ((&lt;$), (&lt;*&gt;))<br>&nbsp; &nbsp; import
 Control.Arrow&nbsp; &nbsp; &nbsp;&nbsp;&nbsp;((&amp;&amp;&amp;))<br>&nbsp; &nbsp; import Control.Monad&nbsp; &nbsp; &nbsp;&nbsp;&nbsp;(guard)<br>&nbsp; &nbsp; import Data.List&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp;(unfoldr)<br><br>&nbsp; &nbsp; makeVerifier f m = (==0) . (`mod` m) . sum . zipWith f [1..] . unfoldr nextDigit<br>&nbsp; &nbsp; &nbsp; &nbsp; where nextDigit = (&lt;$) . (snd &amp;&amp;&amp; fst) . (`divMod` 10) &lt;*&gt; guard . (/= 0)<br><br>- Jake<br></div></blockquote></td></tr></table><br>