To my
>>Yes, yes. I am also suspisious about bringing monads to everywhere.
>>Probably, we need them only to program input (output).
>>As to the random generator, it is natural for it to take, say, a
>>couple of Integers and yield some infinite list. Why should it differ
>>"monadically" from other functions?
Byron Hale <[EMAIL PROTECTED]> writes
>Surely it must be that random number generation cannot be defined
>by an ordinary function, as the results of an inpur vary unacountably.
>Random number generation therefore seems to be analogous to input.
>Hence, monads seem to be as applicable to random number generation
>as to actual IO.
I kept in mind that for a function using random data it is natural to
take these data as the usual argument - a pseudo-random list. Say,
let
rs = someStandardRamdoms 5 7
in
square rs figure
may compute the square of the figure by "throwing" pseudo-random
points to the plane.
Pseudo-randoms are not neccessarily related to input.
But, yes, probably, the *input* randoms are useful too. They break
functionality, but may present the true random values, the ones
taken from the phisical world. As some functional programmers give up
and allow input, they use the input randoms as well.
------------------
Sergey Mechveliani
[EMAIL PROTECTED]