
16 Apr
2012
16 Apr
'12
10:04 p.m.
Ever find yourself wanting to generate a tuple of random things? Instances are trivial to write in Haskell 98: instance (Random a, Random b) => Random (a, b) where randomR ((loL, loR), (hiL, hiR)) g = ((l, r), g'') where (l, g') = randomR (loL, hiL) g (r, g'') = randomR (loR, hiR) g' random g = ((l, r), g'') where (l, g') = random g (r, g'') = random g' Can we add instances like this to System.Random in the random package? -- Dan Burton