-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
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
genRange should be constant for a RandomGen - enforce this with types #38
Conversation
Updates Haskell 98 link
Update README.md
Fix for GHC testsuite
the comment says genRange should *not* examine its argument - well, we can enforce this by types and instead of having genRange with a RandomGen argument, we can create a phantom type GenRange g and let genRange :: GenRange g (with no arguments)
Just to be clear the v2 work isn't on master yet and will be a complete Looks like the middle of my day will be consumed my family events but I'll On Sunday, May 8, 2016, Kubo Kováč [email protected] wrote:
|
Some of the code would be simpler if you had a function like: getRange :: (RandomGen g) => g -> GenRange g
getRange = const genRange |
Yeah, there's definitely a whole bunch of design ideas that are worth On Tuesday, May 10, 2016, Zemyla [email protected] wrote:
|
|
the comment says genRange should not examine its argument - well,
we can enforce this by types and instead of having genRange with a
RandomGen argument, we can create a phantom type GenRange g and
let genRange :: GenRange g (with no arguments)