git.iko.soy/typeable/attoparsec
on master help sign in
Yet more GHC 7.10 fixage
a49b5a6Bryan O'Sullivan
tests/QC/Buffer.hs+3−1
@@ -1,10 +1,12 @@
1−{-# LANGUAGE BangPatterns, FlexibleInstances, OverloadedStrings,
1+{-# LANGUAGE BangPatterns, CPP, FlexibleInstances, OverloadedStrings,
2 TypeSynonymInstances #-}
2 TypeSynonymInstances #-}
3
3
4module QC.Buffer (tests) where
4module QC.Buffer (tests) where
5
5
6import Control.Applicative ((<$>))
6import Control.Applicative ((<$>))
7+#if !MIN_VERSION_base(4,8,0)
7import Data.Monoid (Monoid(mconcat))
8import Data.Monoid (Monoid(mconcat))
9+#endif
8import QC.Common ()
10import QC.Common ()
9import Test.Framework (Test)
11import Test.Framework (Test)
10import Test.Framework.Providers.QuickCheck2 (testProperty)
12import Test.Framework.Providers.QuickCheck2 (testProperty)
tests/QC/Common.hs+5−1
@@ -1,3 +1,4 @@
1+{-# LANGUAGE CPP #-}
1{-# OPTIONS_GHC -fno-warn-orphans #-}
2{-# OPTIONS_GHC -fno-warn-orphans #-}
2module QC.Common
3module QC.Common
3 (
4 (
@@ -13,7 +14,10 @@ module QC.Common
13 , liftOp
14 , liftOp
14 ) where
15 ) where
15
16
17+#if !MIN_VERSION_base(4,8,0)
18+import Control.Applicative ((<*>))
19+#endif
16−import Control.Applicative ((<$>), (<*>))
20+import Control.Applicative ((<$>))
17import Data.Char (isAlpha)
21import Data.Char (isAlpha)
18import Test.QuickCheck
22import Test.QuickCheck
19import Test.QuickCheck.Unicode (shrinkChar, string)
23import Test.QuickCheck.Unicode (shrinkChar, string)
tests/QC/Rechunked.hs+2−1
@@ -6,7 +6,7 @@ module QC.Rechunked (
6 ) where
6 ) where
7
7
8import Control.Monad (forM, forM_)
8import Control.Monad (forM, forM_)
9−import Control.Monad.ST (runST)
9+import Control.Monad.ST (ST, runST)
10import Data.List (unfoldr)
10import Data.List (unfoldr)
11import Test.QuickCheck (Gen, choose)
11import Test.QuickCheck (Gen, choose)
12import qualified Data.ByteString as B
12import qualified Data.ByteString as B
@@ -49,6 +49,7 @@ fisherYates xs = (V.toList . V.backpermute v) `fmap` swapIndices (G.length v)
49 return (runST (swapAll swaps))
49 return (runST (swapAll swaps))
50 where
50 where
51 n = n0 - 1
51 n = n0 - 1
52+ swapAll :: [(Int,Int)] -> ST s (V.Vector Int)
52 swapAll ijs = do
53 swapAll ijs = do
53 mv <- G.unsafeThaw (G.enumFromTo 0 n :: V.Vector Int)
54 mv <- G.unsafeThaw (G.enumFromTo 0 n :: V.Vector Int)
54 forM_ ijs $ uncurry (M.swap mv)
55 forM_ ijs $ uncurry (M.swap mv)