[Haskell-cafe] Confused about Cyclic struture

Henning Thielemann lemming at henning-thielemann.de
Fri Jul 8 13:21:12 EDT 2005

On Fri, 8 Jul 2005, Dinh Tien Tuan Anh wrote:

>   Another question, it's said in the book that using cyclic structure (like
> ones = 1:ones) , the list would be represented by a fixed amount of memory.
>   Does it mean [1,1,1......] only occupy one cell of memory ?
>   How about  in " take 100 [1,1,...] " ?

'take' will certainly ignore the cyclic structure. Even if it could detect
the cycle in its argument there is no way to represent the list of 100
elements more efficiently.

More information about the Haskell-Cafe mailing list