+ 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 Answers
+ 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.