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
54 stars 25 forks source link

mwc-random < 0.13.3.1 needs an upper bound of primitive < 0.6 #46

Closed simonmichael closed 9 years ago

simonmichael commented 9 years ago

Can an upper bound of primitive < 0.6 be added retroactively to mwc-random versions < 0.13.3.1 to prevent problems like this:

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-a6a612b9/build/System/Random/MWC.o )

System/Random/MWC.hs:440:3:
Configuring network-uri-2.6.0.1...
    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
Building nats-1...
    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
Shimuuar commented 9 years ago

I've added upper bound for al mwc-random releases starting from 0.9.0.0 I hope that's enough.

P.S. hackage needs feature for bulk update of package constraints

simonmichael commented 9 years ago

Thanks!