random icon indicating copy to clipboard operation
random copied to clipboard

Instances for `Fixed`

Open lehins opened this issue 4 years ago • 2 comments

One more type from base that is missing some instances.

I think I can see a lawful implementation for HasResolution e => UniformRange (Fixed e) instance. Also considering that we already have instance Random Integer we can definitely add instance HasResolution e => Random (Fixed e)

lehins avatar Jul 01 '20 11:07 lehins

For a change I think UniformRange is perfectly reasonable instance. Only question is what should random return? I think it should follow Dounle/Float/proposed instance for Rationals and return numbers in [0,1] range.

Shimuuar avatar Jul 01 '20 13:07 Shimuuar

Yes, [0, 1] range for Random is also what I had in mind.

lehins avatar Jul 01 '20 13:07 lehins