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

Nicolas Pouillard nicolas.pouillard at gmail.com
Thu Sep 16 07:59:02 EDT 2010


On Wed, 15 Sep 2010 12:27:14 -0300, Felipe Lessa <felipe.lessa at gmail.com> wrote:
> 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

+1

-- 
Nicolas Pouillard
http://nicolaspouillard.fr


More information about the Libraries mailing list