Proposal: Move 'split' into a separate class in System.Random

Felipe Lessa felipe.lessa at gmail.com
Wed Sep 15 11:27:14 EDT 2010


On Wed, Sep 15, 2010 at 12:20 PM, Henning Thielemann
<schlepptop at henning-thielemann.de> wrote:
> I assume that there is more code that uses RandomGen in constraints than
> code that defines instances, thus the split of the split class might
> look like:
>
> class StraightRandomGen g where
>  System.Random.next :: g -> (Int, g)
>  System.Random.genRange :: g -> (Int, Int)
>
> class StraightRandomGen g => RandomGen g where
>  System.Random.split :: g -> (g, g)
>
>
> All existing code that uses RandomGen in constraints would remain valid
> this way.

+1

...although I don't like the name 'Straight'.  =)

-- 
Felipe.


More information about the Libraries mailing list