Skip to content

Make global StdGen to work in MonadIO#119

Merged
idontgetoutmuch merged 1 commit intointerface-to-performancefrom
monad-io-global-stdgen
May 5, 2020
Merged

Make global StdGen to work in MonadIO#119
idontgetoutmuch merged 1 commit intointerface-to-performancefrom
monad-io-global-stdgen

Conversation

@lehins
Copy link
Copy Markdown
Collaborator

@lehins lehins commented May 4, 2020

Instead of IO make all global stdgen functions:

  • getStdRandom
  • getStdGen
  • setStdGen
  • newStdGen
    work in MonadIO

Also, instead of deprecating, move randomIO, randomRIO outside Random class. I can't even understand the reasoning why they where part of the Random class to begin with.

Copy link
Copy Markdown
Collaborator

@curiousleo curiousleo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One question, otherwise LGTM.

Copy link
Copy Markdown
Collaborator

@curiousleo curiousleo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will this break Random instances that define randomIO or randomRIO?

Even if the answer is "yes" in theory, I doubt there are many of them in practice, so I'm in favour of this change.

@idontgetoutmuch idontgetoutmuch merged commit 41863a2 into interface-to-performance May 5, 2020
curiousleo pushed a commit that referenced this pull request May 19, 2020
Shimuuar pushed a commit to Shimuuar/random that referenced this pull request Jan 6, 2025
…-haddock

Improve documentation of the global StdGen.
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

Successfully merging this pull request may close these issues.

3 participants