#1. Note that the example down the page gives bold hints. The solution is:
doGetRandom :: Random a => RandomState a doGetRandom = do gen <- get let (val, gen') = random gen put gen' return val
Answers to the excercises from Real World Haskell, by O'Sullivan, Goerzen, and Stewart.
0 comments:
Post a Comment