Functional random data streams Marc Nieper-Wißkirchen (05 May 2020 06:44 UTC)
Re: Functional random data streams Shiro Kawai (05 May 2020 09:10 UTC)
Re: Functional random data streams Shiro Kawai (05 May 2020 09:12 UTC)
Re: Functional random data streams Marc Nieper-Wißkirchen (05 May 2020 09:26 UTC)
Re: Functional random data streams Marc Nieper-Wißkirchen (05 May 2020 09:35 UTC)
Re: Functional random data streams Shiro Kawai (05 May 2020 10:02 UTC)
Re: Functional random data streams Marc Nieper-Wißkirchen (05 May 2020 10:58 UTC)
Re: Functional random data streams John Cowan (05 May 2020 13:29 UTC)
Re: Functional random data streams Marc Nieper-Wißkirchen (05 May 2020 13:47 UTC)
Re: Functional random data streams Shiro Kawai (05 May 2020 19:45 UTC)
Re: Functional random data streams Marc Nieper-Wißkirchen (05 May 2020 20:00 UTC)
Re: Functional random data streams Shiro Kawai (05 May 2020 20:23 UTC)
Re: Functional random data streams Marc Nieper-Wißkirchen (06 May 2020 17:43 UTC)
Re: Functional random data streams John Cowan (06 May 2020 19:32 UTC)
Re: Functional random data streams Marc Nieper-Wißkirchen (06 May 2020 19:39 UTC)
Re: Functional random data streams John Cowan (06 May 2020 21:11 UTC)
Re: Functional random data streams Marc Nieper-Wißkirchen (07 May 2020 06:10 UTC)
Re: Functional random data streams John Cowan (08 May 2020 18:23 UTC)
Re: Functional random data streams Marc Nieper-Wißkirchen (08 May 2020 18:41 UTC)
Re: Functional random data streams Marc Nieper-Wißkirchen (09 May 2020 08:31 UTC)
Re: Functional random data streams John Cowan (11 May 2020 19:30 UTC)
Re: Functional random data streams Marc Nieper-Wißkirchen (11 May 2020 19:48 UTC)
Re: Functional random data streams Marc Nieper-Wißkirchen (20 Aug 2020 09:39 UTC)
Re: Functional random data streams John Cowan (20 Aug 2020 16:00 UTC)
Re: Functional random data streams Marc Nieper-Wißkirchen (20 Aug 2020 18:23 UTC)
Re: Functional random data streams Arthur A. Gleckler (20 Aug 2020 20:18 UTC)
Re: Functional random data streams Marc Nieper-Wißkirchen (20 Aug 2020 20:27 UTC)
Re: Functional random data streams Arthur A. Gleckler (20 Aug 2020 23:08 UTC)
Re: Functional random data streams Marc Nieper-Wißkirchen (21 Aug 2020 07:01 UTC)

Re: Functional random data streams Marc Nieper-Wißkirchen 05 May 2020 13:47 UTC

Am Di., 5. Mai 2020 um 15:29 Uhr schrieb John Cowan <xxxxxx@ccil.org>:

[...]

> I have no objection to this, though I doubt the reason given.  The very essence of random numbers is that they aren't pure and functional: they depend not only on the state of the machine, but on the state of the physical universe.  Putting them into a  pure data structure doesn't really change that.

It's subtle. While the creation of a stream of random numbers isn't
pure, accessing the stream once created is pure. It is the latter I
have been talking about. For many applications, the creation of a
single random stream is enough. As everything is pure afterward, we
can then step back and forward in time, which, for some applications,
can be interesting to replay experiments, etc.

In Haskell, thanks to explicit types, it is clearer: In Haskell, the
result type of, say MAKE-RANDOM-BOOLEAN-STREAM, would be the IO monad
applied to the type of streams (lists in Haskell) of booleans. The
appearance of the IO monad shows that the creation is not pure. The
stream itself, however, is just a stream of booleans and can be
manipulated with whatever pure procedures, which, finally, can be
lifted to the IO monad.

> It would be appropriate to provide versions not only for SRFI 41 streams, but also for SRFI 127 lazy sequences.  The three SRFIs were intended (by me, not by Philip Bewig) to form a gradient:
> streams are heavyweight and functional, lazy sequences are middleweight and present a functional interface alongside a visibly stateful one; generators are lightweight, stateful. and without memory.

This makes sense as SRFI 127 lazy sequences are also part of R7RS-large.

[...]

Marc