Skip to content
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

Closed
wants to merge 10 commits into from

Conversation

kuk0
Copy link

@kuk0 kuk0 commented May 8, 2016

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)

hvr and others added 10 commits December 21, 2014 10:43
Updates Haskell 98 link
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)
@cartazio
Copy link
Contributor

cartazio commented May 8, 2016

Just to be clear the v2 work isn't on master yet and will be a complete
rewrite of a lot of this stuff :)

Looks like the middle of my day will be consumed my family events but I'll
try to get that branch into shape and public later today

On Sunday, May 8, 2016, Kubo Kováč [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)

You can view, comment on, or merge this pull request online at:

#38
Commit Summary

  • genRange should be constant for a RandomGen - enforce with types

File Changes

Patch Links:


You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub
#38

@Zemyla
Copy link

Zemyla commented May 10, 2016

Some of the code would be simpler if you had a function like:

getRange :: (RandomGen g) => g -> GenRange g
getRange = const genRange

@cartazio
Copy link
Contributor

Yeah, there's definitely a whole bunch of design ideas that are worth
enumerating and comparing.

On Tuesday, May 10, 2016, Zemyla [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


You are receiving this because you commented.
Reply to this email directly or view it on GitHub
#38 (comment)

@lehins
Copy link
Contributor

lehins commented Jun 23, 2020

genRange is now deprecated as of random-1.2. See #62

@lehins lehins closed this Jun 23, 2020
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.

8 participants