|
|
|
|
|
by Tehnix
4607 days ago
|
|
Have you noticed how easy it is to implement circular
data structures or random number generators in C?
The same is not true for Haskell.
I might be wrong, but, isn't this a circular data structure (or, what they are referring to) http://www.haskell.org/haskellwiki/Tying_the_Knot ? In a language like Haskell, where Lists are defined
as Nil | Cons a (List a), creating data structures
like cyclic or doubly linked lists seems impossible.
However, this is not the case: laziness allows for
such definitions, and the procedure of doing so is
called tying the knot.
|
|