2 ms·
It's hard to escape reimplementing streams after reading SICP, because Lazy evaluation is the red pill: http://weblog.raganwald.com/2007/02/haskell-ruby-and-in
by raganwald 15y ago
It's hard to escape reimplementing streams after reading SICP, because Lazy evaluation is the red pill:
http://weblog.raganwald.com/2007/02/haskell-ruby-and-infinity.html http://weblog.raganwald.com/2007/02/haskell-ruby-and-infinit...
- thesz 15y agoAs for "appending infinite lists" I'd like to suggest Control.Monad.Omega: http://hackage.haskell.org/package/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."