We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I want my code to be platform-agnostic, but I can't find example code using Data.Random.Source.IO anywhere in the documentation.
The text was updated successfully, but these errors were encountered:
Data.Random.Source.IO declares a "MonadRandom" instance for IO, which means that random variables can be sampled using the "sample" function.
For example:
sample (uniform 0 10) :: IO Int
Should "just work". If you need to reference it as a concrete "source", you can use the special value StdRandom, as in:
StdRandom
sampleFrom StdRandom (uniform 0 10) :: IO Int
StdRandom is a pseudo-source that refers to the default source of randomness for the monad in which it is used.
Sorry to take so long to reply. I've been mostly offline for a few months.
Sorry, something went wrong.
No branches or pull requests
I want my code to be platform-agnostic, but I can't find example code using Data.Random.Source.IO anywhere in the documentation.
The text was updated successfully, but these errors were encountered: