Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Good choice for fast random generator in Haskell

Tags:

random

haskell

I have a use-case where I want to test a program for some gambling game. The random numbers I need should be in a very small area (1 to 9), and there's no realquality needed. I found out, that the standard generator of Haskell is too slow for me, so anybody whith better ideas?

like image 493
fuz Avatar asked Dec 01 '22 09:12

fuz


2 Answers

The mersenne-random-pure64 package is very fast, as is mwc-random.

like image 112
Don Stewart Avatar answered Dec 21 '22 23:12

Don Stewart


I found out about the Xorshift random gen, which perfectly suits my needs. I'm going to implement it in Haskell and put the implementation online.

It's done: Xorshift is uploaded to hackage, and needs some improvement by me.

like image 34
fuz Avatar answered Dec 21 '22 22:12

fuz