Simon Peyton-Jones wrote:
> b) genRange (snd (next g))  = genRange g
>    genRange (fst (split g)) = genRange g
>    genRange (snd (split g)) = genRange g
I can't see any reason why genRange shouldn't just depend on the type.  So why
not just specify that
   genRange _|_ 
is defined?

I think you should in fact specify, at least for the standard system generators,
that (snd (genRange g)) - (fst (genRange g)) is at least (some large number),
like 2^30 - 1.  That way, if I want a random number between 1 and 6, I can
reduce modulo 6 in the knowledge that the residues 0..5 are all approximately
equally likely.

Reply via email to