Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- The code here is stolen from a comment in the MonadRandom source code.
- -- dependents on MonadRandom library
- import Control.Monad.Random
- die :: RandomGen g => Rand g Int
- die = getRandomR (1,6)
- dice :: RandomGen g => Int -> Rand g [Int]
- dice n = sequence (replicate n die)
- main = do
- rolls <- evalRandIO $ dice 10
- print rolls
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement