Re: [Haskell-cafe] PrimMonad for Control.Monad.ST.Lazy?

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.

On Thu, Apr 09, 2015 at 10:47:29AM +0100, Tom Ellis wrote:
On Thu, Apr 09, 2015 at 05:40:24AM -0400, oleg@okmij.org wrote:
There are alternatives that are more compositional and easier to reason about, including reasoning about performance.
What are you hinting at here?
Oh, perhaps you're talking about your exposition of lazy streams rather than alternatives to lazy evaluation in general. http://okmij.org/ftp/continuations/PPYield/index.html#randoms

On Thu, Apr 9, 2015 at 4:47 PM, Tom Ellis < tom-lists-haskell-cafe-2013@jaguarpaw.co.uk> wrote:
There are alternatives that are more compositional and easier to reason
about, including reasoning about performance.
What are you hinting at here?
I understand Oleg's comment as a set up to a longer essay reappraising the points raised in Hughes' "Why FP matters." I do hope that essay transpires. -- Kim-Ee

Hello,
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.
And from that page:
The monadic stream ListM is not a Haskell list. We have to write our own ListM-processing functions like headL, replicateL, appendL, etc. (There is probably a Hackage package for it.)
Could it be Pipes? Best regards, Marcin Mrotek
participants (4)
-
Kim-Ee Yeoh
-
Marcin Mrotek
-
oleg@okmij.org
-
Tom Ellis