Open ceedubs opened 1 year ago
@ceedubs you can use Random.nat
to generate Nat
in the full range 0 to maxNat, does that help?
@pchiusano yes, but it's a bit annoying. In my current use-case the upper bound is passed in as an argument to the function, so I'll have to check whether the upper bound is maxNat
and use nat
if it is and natIn
if it is not. If the lower bound were also passed in as an argument I think that I'd still have the same trouble.
I would like to generate a
Nat
with an inclusive upper value ofmaxNat
. Is there a straightforward way to do that currently? SincenatIn lower upper
is exclusive onupper
, you can't donatIn lower maxNat
. For cases other thanmaxNat
, you could donatIn lower (increment upper)
, but this will overflow and give an error ifupper
ismaxNat
.See also #169.