News for hackers. Stuff that matters.
Re:When is a recursive function not a recursive function? by belovedeagle on Monday October 06, 2014 @01:57AM (#8414463)
Not so at all. As soon as the runtime decides to head-normalize the "second" element of that list, then there are no more thunks left to evaluate; ones ends up being a circular data structure that you could have written in C. Self-reference is no more meaningless in Haskell than it is in C; that is, it's perfectly well-defined, a pointer back onto itself.

Cf. Scheme: (define list (cons 1 '())) (set-cdr! list list) The only difference with the Haskell is that it requires no mutation (and the same difference exists between Haskell and C). Insofar as that is the case, I suppose you're right in that self-reference by name requires thunks, which are kind of like functions, but not really...

There are no comments on this comment yet.