git.iko.soy/typeable/attoparsec
on master help sign in
Yet more GHC 7.10 fixage
commita49b5a65d5cfd57cfc73056a9e0e0a83eb8db275 authorBryan O'Sullivan <bos@serpentine.com> dateTue 20 Jan 2015, 14:00 (12 years ago) parent5fa1182
3 files changed+10−3
tests/QC/Buffer.hs+3−1 tests/QC/Common.hs+5−1 tests/QC/Rechunked.hs+2−1
tests/QC/Buffer.hs+3−1
@@ -1,10 +1,12 @@
1−{-# LANGUAGE BangPatterns, FlexibleInstances, OverloadedStrings,
1+{-# LANGUAGE BangPatterns, CPP, FlexibleInstances, OverloadedStrings,
22 TypeSynonymInstances #-}
33
44module QC.Buffer (tests) where
55
66import Control.Applicative ((<$>))
7+#if !MIN_VERSION_base(4,8,0)
78import Data.Monoid (Monoid(mconcat))
9+#endif
810import QC.Common ()
911import Test.Framework (Test)
1012import Test.Framework.Providers.QuickCheck2 (testProperty)
tests/QC/Common.hs+5−1
@@ -1,3 +1,4 @@
1+{-# LANGUAGE CPP #-}
12{-# OPTIONS_GHC -fno-warn-orphans #-}
23module QC.Common
34 (
@@ -13,7 +14,10 @@ module QC.Common
1314 , liftOp
1415 ) where
1516
16−import Control.Applicative ((<$>), (<*>))
17+#if !MIN_VERSION_base(4,8,0)
18+import Control.Applicative ((<*>))
19+#endif
20+import Control.Applicative ((<$>))
1721import Data.Char (isAlpha)
1822import Test.QuickCheck
1923import Test.QuickCheck.Unicode (shrinkChar, string)
tests/QC/Rechunked.hs+2−1
@@ -6,7 +6,7 @@ module QC.Rechunked (
66 ) where
77
88import Control.Monad (forM, forM_)
9−import Control.Monad.ST (runST)
9+import Control.Monad.ST (ST, runST)
1010import Data.List (unfoldr)
1111import Test.QuickCheck (Gen, choose)
1212import qualified Data.ByteString as B
@@ -49,6 +49,7 @@ fisherYates xs = (V.toList . V.backpermute v) `fmap` swapIndices (G.length v)
4949 return (runST (swapAll swaps))
5050 where
5151 n = n0 - 1
52+ swapAll :: [(Int,Int)] -> ST s (V.Vector Int)
5253 swapAll ijs = do
5354 mv <- G.unsafeThaw (G.enumFromTo 0 n :: V.Vector Int)
5455 forM_ ijs $ uncurry (M.swap mv)