haskell / attoparsec

A fast Haskell library for parsing ByteStrings
http://hackage.haskell.org/package/attoparsec
Other
512 stars 93 forks source link

Tests fail to compile with GHC 7.10.1-rc1 #92

Closed shlevy closed 9 years ago

shlevy commented 9 years ago
[ 1 of 25] Compiling QC.Rechunked     ( tests/QC/Rechunked.hs, dist/build/tests/tests-tmp/QC/Rechunked.dyn_o )

tests/QC/Rechunked.hs:52:9:
    Non type-variable argument in the constraint: G.Vector v Int
    (Use FlexibleContexts to permit this)
    When checking that ‘swapAll’ has the inferred type
      swapAll :: forall (m :: * -> *) (t :: * -> *) (v :: * -> *).
                 (Foldable t, primitive-0.5.4.0:Control.Monad.Primitive.PrimMonad m,
                  G.Vector v Int, G.Mutable v ~ V.MVector) =>
                 t (Int, Int) -> m (v Int)
    In an equation for ‘swapIndices’:
        swapIndices n0
          = do { swaps <- forM [0 .. n] $ \ i -> ((,) i) `fmap` choose ...;
                 return (runST (swapAll swaps)) }
          where
              n = n0 - 1
              swapAll ijs
                = do { mv <- G.unsafeThaw (G.enumFromTo 0 n :: V.Vector Int);
                       .... }
    In an equation for ‘fisherYates’:
        fisherYates xs
          = (V.toList . V.backpermute v) `fmap` swapIndices (G.length v)
          where
              v = V.fromList xs
              swapIndices n0
                = do { swaps <- forM ... $ ...;
                       .... }
                where
                    n = n0 - 1
                    swapAll ijs = ...

tests/QC/Rechunked.hs:53:46:
    Couldn't match expected type ‘Int’ with actual type ‘b1’
      ‘b1’ is untouchable
        inside the constraints (Foldable t,
                                primitive-0.5.4.0:Control.Monad.Primitive.PrimMonad m,
                                G.Vector v Int,
                                G.Mutable v ~ V.MVector)
        bound by the inferred type of
                 swapAll :: (Foldable t,
                             primitive-0.5.4.0:Control.Monad.Primitive.PrimMonad m,
                             G.Vector v Int, G.Mutable v ~ V.MVector) =>
                            t (Int, Int) -> m (v Int)
        at tests/QC/Rechunked.hs:(52,9)-(55,27)
      ‘b1’ is a rigid type variable bound by
           the inferred type of
           swapIndices :: (Enum b1, Num b1,
                           random-1.1:System.Random.Random b1) =>
                          b1 -> Gen b
           at tests/QC/Rechunked.hs:47:5
    Possible fix: add a type signature for ‘swapIndices’
    Relevant bindings include
      n :: b1 (bound at tests/QC/Rechunked.hs:51:9)
      n0 :: b1 (bound at tests/QC/Rechunked.hs:47:17)
      swapIndices :: b1 -> Gen b (bound at tests/QC/Rechunked.hs:47:5)
    In the second argument of ‘G.enumFromTo’, namely ‘n’
    In the first argument of ‘G.unsafeThaw’, namely
      ‘(G.enumFromTo 0 n :: V.Vector Int)’
bos commented 9 years ago

Should be fixed now.