1 module Main(main) where
5 tstRnd rng = checkRange rng (genRnd 50 rng)
7 genRnd n rng = take n (randomRs rng (mkStdGen 2))
9 checkRange (lo,hi) = all pred
12 | lo <= hi = \ x -> x >= lo && x <= hi
13 | otherwise = \ x -> x >= hi && x <= lo
17 print (tstRnd (1,5::Double))
18 print (tstRnd (1,5::Int))
19 print (tstRnd (10,54::Integer))
20 print (tstRnd ((-6),2::Int))
21 print (tstRnd (2,(-6)::Int))