
3 Feb
2009
3 Feb
'09
9:52 a.m.
2009/2/3 Brent Yorgey
cycle xs = xs' where xs' = xs ++ xs'
That sure looks like a cyclic data structure to me! xs' references a thunk which computes (xs ++ xs'); this thunk, in turn, references xs'. cycle is memory-efficient precisely because it *does* actually construct a cyclic data structure.
That's just magnificent! -- "There is no way to peace; peace is the way"