[Haskell-cafe] Cute code [was: The C Equiv of != in Haskell
miscommunication thread]
Vincent Kraeutler
vincent at kraeutler.net
Tue May 29 06:15:23 EDT 2007
Donald Bruce Stewart wrote:
> P.S. Have some cute code:
>
> Control.Monad.Fix.fix ((1:) . scanl (+) 1)
>
this is cute indeed! (do you keep an emergency reserve of those around
for situations like this? ;-))
ever the interested amateur, i admittedly remain stumped by fix (there's
evidence i'm not the only one [1]), though a little digging turned up
two very nice links, which might be interesting for those who share my
situation (hence this post). namely, an old LtU thread [2], in which you
will find a short oleg-post [3] (i'd give it about a hundred
milli-olegs), and a paper on practical applications of Y [4]. it seems
that the examples given in the latter two (scheme and ML) are
essentially trivial to translate to haskell, so with the help of ghci, i
suppose i will finally get a grip on Y. ;-)
either way, if one of the Masters Of The Shadow Y Style on this list
feels like throwing in another koan or two, you'll have at least one
thankful audience member ;-)
kind regards,
v.
[1] http://www.haskell.org/pipermail/haskell-cafe/2007-March/023662.html
[2] http://lambda-the-ultimate.org/classic/message5463.html
[3] http://okmij.org/ftp/Computation/overriding-selfapplication.html
[4] http://citeseer.ist.psu.edu/mcadams01practical.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 249 bytes
Desc: OpenPGP digital signature
Url : http://www.haskell.org/pipermail/haskell-cafe/attachments/20070529/16c4e4e4/signature.bin
More information about the Haskell-Cafe
mailing list