home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Tools / Languages / MacHaskell 2.2 / progs / lib / cl / random.hs < prev    next >
Encoding:
Text File  |  1994-09-27  |  454 b   |  22 lines  |  [TEXT/YHS2]

  1. -- random.hs -- random number functions
  2. --
  3. -- author :  Sandra Loosemore
  4. -- date   :  22 June 1993
  5. --
  6.  
  7. module Random where
  8.  
  9. import RandomPrims  -- from random-prims.hi
  10.  
  11. class RandomOperand a where
  12.   random    :: a -> IO a
  13.  
  14. instance RandomOperand Int where
  15.   random    = randomInt
  16. instance RandomOperand Integer where
  17.   random    = randomInteger
  18. instance RandomOperand Float where
  19.   random    = randomFloat
  20. instance RandomOperand Double where
  21.   random    = randomDouble
  22.