RE: More on randoms

2000-02-09 Thread Simon Peyton-Jones
| OK, Simon, it looks as if Fergus and Tom are on board. Fine. So I'll go with the optional genRange proposal. In general, the standard libraries have no name conflicts; you can import them all at will. That's not the only possible policy (the other is to name similar things the same and use

Re: More on randoms

2000-02-07 Thread Matt Harden
> So this is really an appeal for code contributions from people who know > the subject intimately. nhc98 has the same primitive FFI as Hugs/ghc, > so in theory, one good implementation in a mixture of C + Haskell > should work for all systems. If you have written one, please make it > available

Re: More on randoms

2000-02-07 Thread Malcolm Wallace
> What about the other Haskell implementations? > Do any of them implement the Haskell 98 Random module yet? nhc98 does not yet implement Random, for the following reasons: * substantial changes were made to the specification at a very late stage; * from the discussions then (when H'98 w

Re: More on randoms

2000-02-05 Thread Matt Harden
Fergus Henderson wrote: > > On 04-Feb-2000, Matt Harden <[EMAIL PROTECTED]> wrote: > > > > > > > class RandomGen g where > > > >next :: g -> (Int, g) > > > >split :: g -> (g, g) > > > >genRange :: g -> (Int, Int) > > > >genRange _ = (minBound, maxBound) > > > > Simon, do you thi

Re: More on randoms

2000-02-05 Thread Fergus Henderson
On 04-Feb-2000, Matt Harden <[EMAIL PROTECTED]> wrote: > > > > > class RandomGen g where > > >next :: g -> (Int, g) > > >split :: g -> (g, g) > > >genRange :: g -> (Int, Int) > > >genRange _ = (minBound, maxBound) > > Simon, do you think we could have the *optional* genRange desc

Re: More on randoms

2000-02-04 Thread Matt Harden
Matt Harden wrote: > > ... Darn. Now I want the genRange operation again. The > "clarification" can really be a significant performance cost. Not to > mention, you're also shortening the period of the RNG (perhaps by a > factor of 4!). > > Can we have both (see below)? > > > class RandomGen

Re: More on randoms

2000-02-04 Thread George Russell
Jerzy Karczmarczuk wrote: > > > class RandomGen g where > > >next :: g -> (Int, g) > > >split :: g -> (g, g) > > >genRange :: g -> (Int, Int) > > >genRange _ = (minBound, maxBound) > > Do you always use integer random numbers? No. But this is the primitive class we're discussing

Re: More on randoms

2000-02-04 Thread Tom Pledger
Jerzy Karczmarczuk writes: > [...] > I would love having 'next' returning reals as well... > And vectors (with decently uncorrelated elements). Etc. > > Do you think that all that must be manufactured by the user, or > can one parameterize the R. Gen. class a bit differently? Try making ea

Re: More on randoms

2000-02-04 Thread Marc van Dongen
Jerzy Karczmarczuk ([EMAIL PROTECTED]) wrote: [...] : the Haskell standard libraries offer only the basic integer RNG, : which will force all the users to reconstruct the needed reals, : this is not extremely painful, but anyway. : I would love having 'next' returning reals as well... : And vec

Re: More on randoms

2000-02-04 Thread Jerzy Karczmarczuk
Two things. We have seen many times (last was Matt Harden) such definitions : > > class RandomGen g where > >next :: g -> (Int, g) > >split :: g -> (g, g) > >genRange :: g -> (Int, Int) > >genRange _ = (minBound, maxBound) Do you always use integer random numbers? I don't know

Re: More on randoms

2000-02-03 Thread Matt Harden
Simon Peyton-Jones wrote: > > | This is a limitation, which precludes the usage of some clever > | generation algorithms needing e.g. a prime modulus, or introducing > | a computational overhead, most probably useless. > > The generator knows its own 'internal' range > (e.g. your prime modulus).

RE: More on randoms

2000-02-03 Thread Simon Peyton-Jones
| This is a limitation, which precludes the usage of some clever | generation algorithms needing e.g. a prime modulus, or introducing | a computational overhead, most probably useless. The generator knows its own 'internal' range (e.g. your prime modulus). All it needs to do is to generate rando

More on randoms

2000-02-03 Thread Jerzy Karczmarczuk
Simon Peyton-Jones: > ... --->>> genRange, > I think it's worth adding. The reasons not to are > > a) it's a change to H98, which should be strongly discouraged > > b) I suppose it's possible that some RNG might not know > its own range, or the range might chan