Typo
[packages/base.git] / tests / rand001.hs
1 module Main(main) where
2
3 import System.Random
4
5 tstRnd rng = checkRange rng (genRnd 50 rng)
6
7 genRnd n rng = take n (randomRs rng (mkStdGen 2))
8
9 checkRange (lo,hi) = all pred
10 where
11 pred
12 | lo <= hi = \ x -> x >= lo && x <= hi
13 | otherwise = \ x -> x >= hi && x <= lo
14
15 main :: IO ()
16 main = do
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))
22