haskell / mwc-random

A very fast Haskell library for generating high quality pseudo-random numbers.
http://hackage.haskell.org/package/mwc-random
BSD 2-Clause "Simplified" License
55 stars 25 forks source link

Compile error on GHC 7.10 #41

Closed taladar closed 9 years ago

taladar commented 9 years ago

Configuring mwc-random-0.13.3.0... Building mwc-random-0.13.3.0... Preprocessing library mwc-random-0.13.3.0... [1 of 3] Compiling System.Random.MWC ( System/Random/MWC.hs, dist/dist-sandbox-13ddcb59/build/System/Random/MWC.o )

System/Random/MWC.hs:440:3: Could not deduce (Control.Monad.Primitive.PrimBase m) arising from a use of ‘unsafePrimToIO’ from the context (PrimMonad m) bound by the type signature for withSystemRandom :: PrimMonad m => (Gen (PrimState m) -> m a) -> IO a at System/Random/MWC.hs:431:21-69 Possible fix: add (Control.Monad.Primitive.PrimBase m) to the context of the type signature for withSystemRandom :: PrimMonad m => (Gen (PrimState m) -> m a) -> IO a In the expression: unsafePrimToIO In a stmt of a 'do' block: unsafePrimToIO $ initialize (I.fromList seed) >>= act In the expression: do { seed <- acquireSeedSystem E.catch \ (_ :: E.IOException) -> do { ... }; unsafePrimToIO $ initialize (I.fromList seed) >>= act }

jonkri commented 9 years ago

I got this with GHC 7.8 just now.

Shimuuar commented 9 years ago

Fixed by #40

jonkri commented 9 years ago

Thanks!