Re:Introducing a new data structure, streams, in Javascript
by thesz on Sunday September 11, 2011 @07:18PM
(#2985159)
As for "appending infinite lists" I'd like to suggest Control.Monad.Omega: http://hackage.haskell.org/package/control-monad-omega
"A monad for enumerating sets: like the list monad, but impervious to infinite descent.
A depth-first search of a data structure can fail to give a full traversal if it has an infinitely deep path. Likewise, a breadth-first search of a data structure can fall short if it has an infinitely branching node. Omega addresses this problem by using a "diagonal" traversal that gracefully dissolves such data."
http://weblog.raganwald.com/2007/02/haskell-ruby-and-infinit...