-
Notifications
You must be signed in to change notification settings - Fork 21
Open
Description
I'm trying to port some code (lambdabot/lambdabot#204) that previously used sample v in an IO context to random-fu 0.3 in order to compile on GHC 9. This doesn't work anymore because the MonadRandom IO instance is gone, so after digging around in the source code I eventually figured out I needed something like do g <- MWC.createSystemRandom; sampleFrom g v.
I think this could be made clearer in the documentation as it seems like a common usecase?
Also, I'm not sure what the difference would be between using MWC.createSystemRandom and newIOGenM =<< newStdGen (assuming this is a silly "get a random quote" application and not anything needing Serious Random Numbers™).
freckletonj and sullyj3
Metadata
Metadata
Assignees
Labels
No labels