Commits

Bryan O'Sullivan committed 7257832

Add aliases for GenIO and GenST

Comments (0)

Files changed (1)

System/Random/MWC.hs

     (
     -- * Types
       Gen
+    , GenIO
+    , GenST
     , Seed
     , Variate(..)
     -- * Other distributions
 
 import Control.Exception (IOException, catch)
 import Control.Monad (ap, liftM, unless)
+import Control.Monad.ST (ST)
 import Control.Monad.Primitive (PrimMonad, PrimState, unsafePrimToIO)
 import Data.Bits ((.&.), (.|.), xor)
 import Data.IORef (atomicModifyIORef, newIORef)
 -- | State of the pseudo-random number generator.
 newtype Gen s = Gen (M.MVector s Word32)
 
+-- | A shorter name for PRNG state in the IO monad.
+type GenIO = Gen (PrimState IO)
+
+-- | A shorter name for PRNG state in the ST monad.
+type GenST s = Gen (PrimState (ST s))
+
 ioff, coff :: Int
 ioff = 256
 coff = 257