[Haskell-cafe] PrimMonad for Control.Monad.ST.Lazy?
oleg at okmij.org
oleg at okmij.org
Thu Apr 9 09:40:24 UTC 2015
Ken Takusagawa II wrote:
> What I Am Really Trying To Do: get a purely lazy stream of random values
Streams of random data is actually somewhat popular structure, and has
been asked about before. What was also found out that such lazy
streams are fraught with problems. Some are described on this page:
http://okmij.org/ftp/continuations/PPYield/index.html#randoms
The page also shows two solutions, which are robust and easy to reason
about.
Lazy evaluation does promote compositionality on one hand, and it also
inhibits compositionality. Reasoning about lazy programs is inherently
non-compositional, breaking abstraction boundaries, as the page
demonstrates. Overall, lazy evaluation has not worked out as it was
originally hoped for. There are alternatives that are more
compositional and easier to reason about, including reasoning about
performance.
More information about the Haskell-Cafe
mailing list