Re:A self-infecting datatype in Lisp
by draven on Tuesday January 24, 2012 @09:43AM
(#3504901)
I'm learning Haskell ATM and it looks similar to lazy lists in WHNF, as at each step you get an element and a "thunk" that can be used to compute the next step.
Re:A self-infecting datatype in Lisp
by eridius on Tuesday January 24, 2012 @03:45PM
(#3506671)
This is similar to one of my favorite Haskell "tricks": Tying the Knot. It's kind of a mindfuck the first time you do it, but it also feels really really cool.
The code for the cycle Haskell function is really simple: http://hackage.haskell.org/packages/archive/base/latest/doc/...