+ 6
Is it not possible to generate a pseudo random number via a function in a functional programming language?
Because a function in such a language needs to produce the same output for a given or null input? Otherwise, can a long pseudorandom sequence be used and the function be called with a sequential input each time?
3 Respostas
+ 7
Happy testing Mane SoloTest
+ 4
Mane SoloTest helpful in what way?
+ 1
“We get the same answer twice because the underlying function [random] that’s deciding the values returned is pure; the type doesn’t permit the performance of any effects to get spooky action.”
Excerpt From
Haskell Programming from first principles
This material may be protected by copyright.
So it seems like the pseudorandom number generator is pure. I’m not sure how though.