Skip to content

Migration to 0.3 could use more documentation #83

@ncfavier

Description

@ncfavier

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™).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions