Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

It would be nice if MonadRandom did not depend on System.Random #31

Closed
jeffreyrosenbluth opened this issue Nov 17, 2016 · 3 comments
Closed

Comments

@jeffreyrosenbluth
Copy link

In particular if the IO instance was not tied to randomIO and stdGen.
So that we could plug in other prng's like tf-random for things like evalRandIO.

@tom-bop
Copy link

tom-bop commented Feb 15, 2018

Does this mean there's currently no way to use MonadRandom and avoid the wonky behavior of http://kenta.blogspot.co.nz/2014/02/rzzllapd-nonrandomness-of-first-random.html ?

@tom-bop
Copy link

tom-bop commented Feb 15, 2018

Hm, appears we can at least work around it(?). Sorry for the noise if so.

>  :m + Control.Monad.Random
>  :m + System.Random.TF
>  (fst . randomR (0::Int, 7)) <$> newTFGen
5

@lehins
Copy link
Contributor

lehins commented Apr 3, 2021

All these issues has been fixed in random-1.2.

IO instance for MonadRandom is a limitation of design IMHO, which has also been solved with StatefulGen in random-1.2

@byorgey byorgey closed this as completed Apr 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants