[Haskell-cafe] In relation to shuffling
GK at ninebynine.org
Thu Jul 8 16:07:12 EDT 2004
At 21:40 08/07/04 +0200, paolo veronelli wrote:
>Most of my imperative pieces of software find their answers by touching
>around in some space
>of solutions and my favourite approximation algorithms use random
>Is it haskell the wrong languages for those, as I'm obliged to code them
>loosing the benefits of lazyness?
I don't see any reason to sacrifice the benefits of laziness.
I can imagine a program that uses internally a random sequence of
values. Given a suitable pseudo-random value generator, it would be quite
possible to write a pure function that accepts as one its parameters a seed
for the P-R generator.
For many randomized algorithms, I think this should work fine, though I
don't recommend this approach for cryptographic work.
More information about the Haskell-Cafe