
5 Oct
2009
5 Oct
'09
4:28 p.m.
p.f.moore:
I notice that System.Random.Mersenne has no randomR variants. Is there a reason for this, or is it just an oversight? It makes porting code from System.Random a little more complicated than it needs to be. I know it's possible to write a function mapping a Double (or other value, as appropriate) to a range, effectively replacing randomR, but it's fiddly to get the edge cases right. A standard implementation would be helpful.
Basically, to use the type class interface defined in System.Random, you will suffer a 100x decrease in performance, as the instances all convert via Integer. Rather than give people a surprise, I chose not to implement that interface. -- Don