on master help sign in
Drop GHC 8.x to 8.2.x Support
commit07bf70d5f86df7ed7952c245f950a308669694af authorRanjeet Kumar Ranjan <ranjeetr@composewell.com> dateThu 17 Mar 2022, 22:56 (5 years ago) parent1b8043f
30 files changed+20−236
.circleci/config.yml+4−4 benchmark/Streamly/Benchmark/Data/Parser.hs−4 benchmark/Streamly/Benchmark/FileSystem/Handle.hs−4 benchmark/Streamly/Benchmark/FileSystem/Handle/Read.hs−4 benchmark/lib/Streamly/Benchmark/Common.hs−2 benchmark/lib/Streamly/Benchmark/Prelude.hs−3 core/src/Streamly/Internal/BaseCompat.hs+3−23 core/src/Streamly/Internal/Data/Array/Foreign.hs−3 core/src/Streamly/Internal/Data/Array/Foreign/Mut/Type.hs−4 core/src/Streamly/Internal/Data/Array/Stream/Fold/Foreign.hs−2 core/src/Streamly/Internal/Data/Fold.hs−9 core/src/Streamly/Internal/Data/List.hs+1−4 core/src/Streamly/Internal/Data/Parser/ParserD/Type.hs+1−2 core/src/Streamly/Internal/Data/Parser/ParserK/Type.hs+1−10 core/src/Streamly/Internal/Data/Stream/Serial.hs−2 core/src/Streamly/Internal/Data/Stream/StreamD/Nesting.hs−4 core/src/Streamly/Internal/Data/Stream/StreamD/Type.hs−4 src/Streamly/Internal/Data/SmallArray/Type.hs+9−73 src/Streamly/Internal/Data/Stream/IsStream/Top.hs−3 src/Streamly/Internal/Data/Stream/IsStream/Transform.hs−9 src/Streamly/Internal/FileSystem/Event/Linux.hs−26 src/Streamly/Internal/FileSystem/FDIO.hs−2 streamly.cabal+1−2 test/Streamly/Test/Data/List.hs−7 test/Streamly/Test/Prelude.hs−3 test/Streamly/Test/Prelude/Concurrent.hs−3 test/Streamly/Test/Prelude/Parallel.hs−3 test/Streamly/Test/Prelude/WAsync.hs−3 test/Streamly/Test/Unicode/Char.hs−8 test/lib/Streamly/Test/Prelude/Common.hs−6
.circleci/config.yml+4−4
@@ -404,10 +404,10 @@ workflows:
404404 #- cabal-ghc-8.6.5
405405 #- cabal-ghc-8_4_4:
406406 # name: GHC 8.4.4 + x86 + debug
407− - cabal-ghc-8_2_2:
408− name: GHC 8.2.2 + no-test + no-bench + no-docs
409− - cabal-ghc-8_0_2:
410− name: GHC 8.0.2 + no-test + no-bench + no-docs
407+ #- cabal-ghc-8_2_2:
408+ # name: GHC 8.2.2 + no-test + no-bench + no-docs
409+ #- cabal-ghc-8_0_2:
410+ # name: GHC 8.0.2 + no-test + no-bench + no-docs
411411 #- cabal-ghc-7.10.3
412412 - cabal-ghcjs-8_4:
413413 name: GHCJS 8.4 + no-test + no-docs
benchmark/Streamly/Benchmark/Data/Parser.hs−4
@@ -20,11 +20,7 @@ import Data.Functor (($>))
2020import Data.Maybe (fromMaybe)
2121import Data.Monoid (Sum(..))
2222import GHC.Magic (inline)
23−#if __GLASGOW_HASKELL__ >= 802
2423import GHC.Magic (noinline)
25−#else
26−#define noinline
27−#endif
2824import System.IO (Handle)
2925import System.Random (randomRIO)
3026import Prelude
benchmark/Streamly/Benchmark/FileSystem/Handle.hs−4
@@ -17,10 +17,6 @@
1717{-# LANGUAGE TemplateHaskell #-}
1818{-# OPTIONS_GHC -fplugin Test.Inspection.Plugin #-}
1919#endif
20−
21−#if __GLASGOW_HASKELL__ >= 800
22−#endif
23−
2420import Streamly.Benchmark.Common.Handle (mkHandleBenchEnv)
2521
2622import qualified Handle.ReadWrite as RW
benchmark/Streamly/Benchmark/FileSystem/Handle/Read.hs−4
@@ -24,11 +24,7 @@ where
2424
2525import Data.Word (Word8)
2626import GHC.Magic (inline)
27−#if __GLASGOW_HASKELL__ >= 802
2827import GHC.Magic (noinline)
29−#else
30−#define noinline
31−#endif
3228import System.IO (Handle)
3329
3430import qualified Streamly.FileSystem.Handle as FH
benchmark/lib/Streamly/Benchmark/Common.hs−2
@@ -1,7 +1,5 @@
11{-# LANGUAGE CPP #-}
2−#if __GLASGOW_HASKELL__ >= 800
32{-# OPTIONS_GHC -Wno-orphans #-}
4−#endif
53
64-- |
75-- Module : Streamly.Benchmark.Common
benchmark/lib/Streamly/Benchmark/Prelude.hs−3
@@ -68,9 +68,6 @@ import Control.Applicative (liftA2)
6868import Control.DeepSeq (NFData(..))
6969import Control.Exception (try)
7070import Data.Functor.Identity (Identity)
71−#if !(MIN_VERSION_base(4,11,0))
72−import Data.Semigroup (Semigroup((<>)))
73−#endif
7471import GHC.Exception (ErrorCall)
7572import Prelude hiding (mapM)
7673import System.Random (randomRIO)
core/src/Streamly/Internal/BaseCompat.hs+3−23
@@ -19,38 +19,22 @@ module Streamly.Internal.BaseCompat
1919where
2020
2121import Data.Coerce (Coercible, coerce)
22−#if MIN_VERSION_base(4,10,0)
2322import Data.Either (fromRight, fromLeft)
24−import qualified GHC.Exts as GHCExt
25−#endif
2623import GHC.ForeignPtr (ForeignPtr(..))
2724import GHC.Ptr (Ptr(..))
25+
26+import qualified GHC.Exts as GHCExt
2827#if MIN_VERSION_base(4,15,0)
2928import qualified GHC.ForeignPtr as GHCForeignPtr
3029#else
3130import Foreign.ForeignPtr (withForeignPtr)
3231#endif
3332
33+
3434{-# INLINE (#.) #-}
3535(#.) :: Coercible b c => (b -> c) -> (a -> b) -> (a -> c)
3636(#.) _f = coerce
3737
38−#if !(MIN_VERSION_base(4,9,0))
39−{-# NOINLINE errorWithoutStackTrace #-}
40−errorWithoutStackTrace :: String -> a
41−errorWithoutStackTrace = error
42−#endif
43−
44−#if !(MIN_VERSION_base(4,10,0))
45−fromLeft :: a -> Either a b -> a
46−fromLeft _ (Left a) = a
47−fromLeft a _ = a
48−
49−fromRight :: b -> Either a b -> b
50−fromRight _ (Right b) = b
51−fromRight b _ = b
52−#endif
53−
5438unsafeWithForeignPtr :: ForeignPtr a -> (Ptr a -> IO b) -> IO b
5539#if MIN_VERSION_base(4,15,0)
5640unsafeWithForeignPtr = GHCForeignPtr.unsafeWithForeignPtr
@@ -59,8 +43,4 @@ unsafeWithForeignPtr = withForeignPtr
5943#endif
6044
6145oneShot :: (a -> b) -> a -> b
62−#if MIN_VERSION_base(4,10,0)
6346oneShot = GHCExt.oneShot
64−#else
65−oneShot = id
66−#endif
core/src/Streamly/Internal/Data/Array/Foreign.hs−3
@@ -120,9 +120,6 @@ import Control.Exception (assert)
120120import Control.Monad (when)
121121import Control.Monad.IO.Class (MonadIO(..))
122122import Data.Functor.Identity (Identity)
123−#if !(MIN_VERSION_base(4,11,0))
124−import Data.Semigroup ((<>))
125−#endif
126123import Data.Word (Word8)
127124import Foreign.C.String (CString)
128125import Foreign.Ptr (plusPtr, castPtr)
core/src/Streamly/Internal/Data/Array/Foreign/Mut/Type.hs−4
@@ -231,11 +231,7 @@ import GHC.Base
231231#ifndef USE_FOREIGN_PTR
232232import GHC.Base (RealWorld, MutableByteArray#)
233233#endif
234−#if __GLASGOW_HASKELL__ < 802
235−#define noinline
236−#else
237234import GHC.Base (noinline)
238−#endif
239235import GHC.Exts (unsafeCoerce#)
240236import GHC.ForeignPtr (ForeignPtr(..), ForeignPtrContents(..))
241237#ifdef USE_C_MALLOC
core/src/Streamly/Internal/Data/Array/Stream/Fold/Foreign.hs−2
@@ -258,10 +258,8 @@ instance MonadThrow m => Applicative (Fold m a) where
258258 {-# INLINE (*>) #-}
259259 (*>) = serial_
260260
261−#if MIN_VERSION_base(4,10,0)
262261 {-# INLINE liftA2 #-}
263262 liftA2 f x = (<*>) (fmap f x)
264−#endif
265263
266264-------------------------------------------------------------------------------
267265-- Monad
core/src/Streamly/Internal/Data/Fold.hs−9
@@ -263,9 +263,6 @@ import Data.Functor.Identity (Identity(..))
263263import Data.Int (Int64)
264264import Data.Map.Strict (Map)
265265import Data.Maybe (isJust, fromJust)
266−#if __GLASGOW_HASKELL__ < 804
267−import Data.Semigroup (Semigroup((<>)))
268−#endif
269266import Streamly.Internal.BaseCompat (fromLeft, fromRight)
270267import Streamly.Internal.Data.Either.Strict
271268 (Either'(..), fromLeft', fromRight', isLeft', isRight')
@@ -838,9 +835,6 @@ sconcat = foldl' (<>)
838835{-# INLINE mconcat #-}
839836mconcat ::
840837 ( Monad m
841−#if !MIN_VERSION_base(4,11,0)
842− , Semigroup a
843−#endif
844838 , Monoid a) => Fold m a a
845839mconcat = sconcat mempty
846840
@@ -856,9 +850,6 @@ mconcat = sconcat mempty
856850-- @since 0.7.0
857851{-# INLINE foldMap #-}
858852foldMap :: (Monad m, Monoid b
859−#if !MIN_VERSION_base(4,11,0)
860− , Semigroup b
861−#endif
862853 ) => (a -> b) -> Fold m a b
863854foldMap f = lmap f mconcat
864855
core/src/Streamly/Internal/Data/List.hs+1−4
@@ -67,11 +67,10 @@ import Control.DeepSeq (NFData(..))
6767import Control.DeepSeq (NFData1(..))
6868#endif
6969import Data.Functor.Identity (Identity, runIdentity)
70+import GHC.Exts (IsList(..), IsString(..))
7071#if __GLASGOW_HASKELL__ < 808
7172import Data.Semigroup (Semigroup(..))
7273#endif
73−import GHC.Exts (IsList(..), IsString(..))
74−
7574import Streamly.Internal.Data.Stream.Serial (SerialT(..))
7675import Streamly.Internal.Data.Stream.Zip (ZipSerialM(..))
7776
@@ -148,9 +147,7 @@ pattern Cons x xs <-
148147
149148 Cons x xs = List $ Serial.cons x (toSerial xs)
150149
151−#if __GLASGOW_HASKELL__ >= 802
152150{-# COMPLETE Nil, Cons #-}
153−#endif
154151
155152------------------------------------------------------------------------------
156153-- ZipList
core/src/Streamly/Internal/Data/Parser/ParserD/Type.hs+1−2
@@ -905,10 +905,9 @@ instance MonadThrow m => Applicative (Parser m a) where
905905 {-# INLINE (*>) #-}
906906 (*>) = split_
907907
908−#if MIN_VERSION_base(4,10,0)
909908 {-# INLINE liftA2 #-}
910909 liftA2 f x = (<*>) (fmap f x)
911−#endif
910+
912911
913912-------------------------------------------------------------------------------
914913-- Sequential Alternative
core/src/Streamly/Internal/Data/Parser/ParserK/Type.hs+1−10
@@ -36,12 +36,8 @@ import Control.Monad.Catch (MonadCatch, MonadThrow(..))
3636import Control.Monad.IO.Class (MonadIO, liftIO)
3737import Control.Monad.Reader.Class (MonadReader, ask, local)
3838import Control.Monad.State.Class (MonadState, get, put)
39−#if MIN_VERSION_base(4,9,0)
4039import qualified Control.Monad.Fail as Fail
41−#endif
42−#if !(MIN_VERSION_base(4,10,0))
43−import Data.Semigroup ((<>))
44−#endif
40+
4541
4642-- | The parse driver result. The driver may stop with a final result, pause
4743-- with a continuation to resume, or fail with an error.
@@ -157,10 +153,8 @@ instance Monad m => Applicative (Parser m a) where
157153 yield1 s (Error e) = yieldk s (Error e)
158154 in runParser m1 lo st yield1
159155
160−#if MIN_VERSION_base(4,10,0)
161156 {-# INLINE liftA2 #-}
162157 liftA2 f x = (<*>) (fmap f x)
163−#endif
164158
165159-------------------------------------------------------------------------------
166160-- Monad
@@ -238,12 +232,9 @@ instance Monad m => Monad (Parser m a) where
238232 {-# INLINE fail #-}
239233 fail = die
240234#endif
241−
242−#if MIN_VERSION_base(4,9,0)
243235instance Monad m => Fail.MonadFail (Parser m a) where
244236 {-# INLINE fail #-}
245237 fail = die
246−#endif
247238
248239instance (MonadThrow m, MonadReader r m, MonadCatch m) =>
249240 MonadReader r (Parser m a) where
core/src/Streamly/Internal/Data/Stream/Serial.hs−2
@@ -234,10 +234,8 @@ instance Monad m => Applicative (SerialT m) where
234234 (<*>) = apSerial
235235 -- (<*>) = K.apSerial
236236
237−#if MIN_VERSION_base(4,10,0)
238237 {-# INLINE liftA2 #-}
239238 liftA2 f x = (<*>) (fmap f x)
240−#endif
241239
242240 {-# INLINE (*>) #-}
243241 (*>) = apSequence
core/src/Streamly/Internal/Data/Stream/StreamD/Nesting.hs−4
@@ -153,9 +153,7 @@ import Control.Exception (assert)
153153import Control.Monad.Catch (MonadThrow, throwM)
154154import Control.Monad.IO.Class (MonadIO(..))
155155import Data.Bits (shiftR, shiftL, (.|.), (.&.))
156−#if __GLASGOW_HASKELL__ >= 801
157156import Data.Functor.Identity ( Identity )
158−#endif
159157import Data.Word (Word32)
160158import Foreign.Storable (Storable(..))
161159import Fusion.Plugin.Types (Fuse(..))
@@ -424,10 +422,8 @@ zipWithM f (Stream stepa ta) (Stream stepb tb) = Stream step (ta, tb, Nothing)
424422 Skip sb' -> return $ Skip (sa, sb', Just x)
425423 Stop -> return Stop
426424
427−#if __GLASGOW_HASKELL__ >= 801
428425{-# RULES "zipWithM xs xs"
429426 forall f xs. zipWithM @Identity f xs xs = mapM (\x -> f x x) xs #-}
430−#endif
431427
432428{-# INLINE zipWith #-}
433429zipWith :: Monad m => (a -> b -> c) -> Stream m a -> Stream m b -> Stream m c
core/src/Streamly/Internal/Data/Stream/StreamD/Type.hs−4
@@ -128,9 +128,7 @@ pattern Stream :: (State K.Stream m a -> s -> m (Step s a)) -> s -> Stream m a
128128pattern Stream step state <- (unShare -> UnStream step state)
129129 where Stream = UnStream
130130
131−#if __GLASGOW_HASKELL__ >= 802
132131{-# COMPLETE Stream #-}
133−#endif
134132
135133------------------------------------------------------------------------------
136134-- Primitives
@@ -744,10 +742,8 @@ instance Applicative f => Applicative (Stream f) where
744742 {-# INLINE (<*>) #-}
745743 (<*>) = concatAp
746744
747−#if MIN_VERSION_base(4,10,0)
748745 {-# INLINE liftA2 #-}
749746 liftA2 f x = (<*>) (fmap f x)
750−#endif
751747
752748 {-# INLINE (*>) #-}
753749 (*>) = apSequence
src/Streamly/Internal/Data/SmallArray/Type.hs+9−73
@@ -56,12 +56,8 @@ module Streamly.Internal.Data.SmallArray.Type
5656
5757import GHC.Exts hiding (toList)
5858import qualified GHC.Exts
59−
6059import Control.Applicative
6160import Control.Monad
62−#if MIN_VERSION_base(4,9,0)
63−import qualified Control.Monad.Fail as Fail
64−#endif
6561import Control.Monad.Fix
6662import Control.Monad.Primitive
6763import Control.Monad.ST
@@ -69,22 +65,12 @@ import Control.Monad.Zip
6965import Data.Data
7066import Data.Foldable as Foldable
7167import Data.Functor.Identity
72−#if !(MIN_VERSION_base(4,10,0))
73−import Data.Monoid
74−#endif
75−#if MIN_VERSION_base(4,9,0)
76−import qualified GHC.ST as GHCST
77−import qualified Data.Semigroup as Sem
78−#endif
79−import Text.ParserCombinators.ReadP
68+import Data.Functor.Classes (Eq1(..),Ord1(..),Show1(..),Read1(..))
8069
81−#if MIN_VERSION_base(4,9,0) && !MIN_VERSION_base(4,10,0)
82−import GHC.Base (runRW#)
83−#endif
70+import qualified Control.Monad.Fail as Fail
71+import qualified GHC.ST as GHCST
8472
85−#if MIN_VERSION_base(4,9,0) || MIN_VERSION_transformers(0,4,0)
86−import Data.Functor.Classes (Eq1(..),Ord1(..),Show1(..),Read1(..))
87−#endif
73+import Text.ParserCombinators.ReadP
8874
8975data SmallArray a = SmallArray (SmallArray# a)
9076 deriving Typeable
@@ -92,6 +78,7 @@ data SmallArray a = SmallArray (SmallArray# a)
9278data SmallMutableArray s a = SmallMutableArray (SmallMutableArray# s a)
9379 deriving Typeable
9480
81+
9582-- | Create a new small mutable array.
9683newSmallArray
9784 :: PrimMonad m
@@ -318,14 +305,6 @@ mapSmallArray' f sa = createSmallArray (length sa) (die "mapSmallArray'" "imposs
318305 let !y = f x
319306 writeSmallArray smb i y *> go (i+1)
320307{-# INLINE mapSmallArray' #-}
321−
322−#if !MIN_VERSION_base(4,9,0)
323−runSmallArray
324− :: (forall s. ST s (SmallMutableArray s a))
325− -> SmallArray a
326−runSmallArray m = runST $ m >>= unsafeFreezeSmallArray
327−
328−#else
329308-- This low-level business is designed to work with GHC's worker-wrapper
330309-- transformation. A lot of the time, we don't actually need an Array
331310-- constructor. By putting it on the outside, and being careful about
@@ -348,8 +327,6 @@ runSmallArray# m = case runRW# $ \s ->
348327unST :: ST s a -> State# s -> (# State# s, a #)
349328unST (GHCST.ST f) = f
350329
351−#endif
352−
353330-- See the comment on runSmallArray for why we use emptySmallArray#.
354331createSmallArray
355332 :: Int
@@ -393,20 +370,11 @@ smallArrayLiftEq p sa1 sa2 = length sa1 == length sa2 && loop (length sa1 - 1)
393370 | (# x #) <- indexSmallArray## sa1 i
394371 , (# y #) <- indexSmallArray## sa2 i
395372 = p x y && loop (i-1)
396−
397−#if MIN_VERSION_base(4,9,0) || MIN_VERSION_transformers(0,4,0)
398−-- | @since 0.6.4.0
399373instance Eq1 SmallArray where
400−#if MIN_VERSION_base(4,9,0) || MIN_VERSION_transformers(0,5,0)
401374 liftEq = smallArrayLiftEq
402−#else
403− eq1 = smallArrayLiftEq (==)
404−#endif
405−#endif
406375
407376instance Eq a => Eq (SmallArray a) where
408377 sa1 == sa2 = smallArrayLiftEq (==) sa1 sa2
409−
410378instance Eq (SmallMutableArray s a) where
411379 SmallMutableArray sma1# == SmallMutableArray sma2# =
412380 isTrue# (sameSmallMutableArray# sma1# sma2#)
@@ -422,15 +390,8 @@ smallArrayLiftCompare elemCompare a1 a2 = loop 0
422390 = elemCompare x1 x2 `mappend` loop (i+1)
423391 | otherwise = compare (length a1) (length a2)
424392
425−#if MIN_VERSION_base(4,9,0) || MIN_VERSION_transformers(0,4,0)
426−-- | @since 0.6.4.0
427393instance Ord1 SmallArray where
428−#if MIN_VERSION_base(4,9,0) || MIN_VERSION_transformers(0,5,0)
429394 liftCompare = smallArrayLiftCompare
430−#else
431− compare1 = smallArrayLiftCompare compare
432−#endif
433−#endif
434395
435396-- | Lexicographic ordering. Subject to change between major versions.
436397instance Ord a => Ord (SmallArray a) where
@@ -668,11 +629,8 @@ instance Monad SmallArray where
668629#if !(MIN_VERSION_base(4,13,0)) && MIN_VERSION_base(4,9,0)
669630 fail = Fail.fail
670631#endif
671−
672−#if MIN_VERSION_base(4,9,0)
673632instance Fail.MonadFail SmallArray where
674633 fail _ = emptySmallArray
675−#endif
676634
677635instance MonadPlus SmallArray where
678636 mzero = empty
@@ -715,24 +673,19 @@ instance MonadFix SmallArray where
715673 sz = sizeofSmallArray (f err)
716674 err = error "mfix for Data.Primitive.SmallArray applied to strict function."
717675
718−#if MIN_VERSION_base(4,9,0)
719676-- | @since 0.6.3.0
720−instance Sem.Semigroup (SmallArray a) where
677+instance Semigroup (SmallArray a) where
721678 (<>) = (<|>)
722− sconcat = mconcat . toList
723−#endif
724679
725680instance Monoid (SmallArray a) where
726681 mempty = empty
727−#if !(MIN_VERSION_base(4,11,0))
728− mappend = (<|>)
729−#endif
682+ mappend = (<>)
730683 mconcat l = createSmallArray n (die "mconcat" "impossible") $ \ma ->
731684 let go !_ [ ] = return ()
732685 go off (a:as) =
733686 copySmallArray ma off a 0 (sizeofSmallArray a) >> go (off + sizeofSmallArray a) as
734− in go 0 l
735− where n = sum . fmap length $ l
687+ in go 0 l
688+ where n = sum . fmap length $ l
736689
737690instance IsList (SmallArray a) where
738691 type Item (SmallArray a) = a
@@ -751,16 +704,8 @@ listLiftShowsPrec _ sl _ = sl
751704
752705instance Show a => Show (SmallArray a) where
753706 showsPrec = smallArrayLiftShowsPrec showsPrec showList
754−
755−#if MIN_VERSION_base(4,9,0) || MIN_VERSION_transformers(0,4,0)
756−-- | @since 0.6.4.0
757707instance Show1 SmallArray where
758−#if MIN_VERSION_base(4,9,0) || MIN_VERSION_transformers(0,5,0)
759708 liftShowsPrec = smallArrayLiftShowsPrec
760−#else
761− showsPrec1 = smallArrayLiftShowsPrec showsPrec showList
762−#endif
763−#endif
764709
765710smallArrayLiftReadsPrec :: (Int -> ReadS a) -> ReadS [a] -> Int -> ReadS (SmallArray a)
766711smallArrayLiftReadsPrec _ listReadsPrec p = readParen (p > 10) . readP_to_S $ do
@@ -774,17 +719,8 @@ smallArrayLiftReadsPrec _ listReadsPrec p = readParen (p > 10) . readP_to_S $ do
774719instance Read a => Read (SmallArray a) where
775720 readsPrec = smallArrayLiftReadsPrec readsPrec readList
776721
777−#if MIN_VERSION_base(4,9,0) || MIN_VERSION_transformers(0,4,0)
778−-- | @since 0.6.4.0
779722instance Read1 SmallArray where
780−#if MIN_VERSION_base(4,9,0) || MIN_VERSION_transformers(0,5,0)
781723 liftReadsPrec = smallArrayLiftReadsPrec
782−#else
783− readsPrec1 = smallArrayLiftReadsPrec readsPrec readList
784−#endif
785−#endif
786−
787−
788724
789725smallArrayDataType :: DataType
790726smallArrayDataType =
src/Streamly/Internal/Data/Stream/IsStream/Top.hs−3
@@ -58,9 +58,6 @@ import Data.Function ((&))
5858import Data.IORef (newIORef, readIORef, modifyIORef')
5959import Data.Kind (Type)
6060import Data.Maybe (isJust)
61−#if !(MIN_VERSION_base(4,11,0))
62−import Data.Semigroup (Semigroup(..))
63−#endif
6461import Streamly.Internal.Control.Concurrent (MonadAsync)
6562import Streamly.Internal.Data.Stream.IsStream.Common (concatM)
6663import Streamly.Internal.Data.Stream.IsStream.Type
src/Streamly/Internal/Data/Stream/IsStream/Transform.hs−9
@@ -257,9 +257,6 @@ import qualified Streamly.Internal.Data.Fold as FL
257257import qualified Streamly.Internal.Data.Stream.Parallel as Par
258258import qualified Streamly.Internal.Data.Stream.Serial as Serial
259259import qualified Streamly.Internal.Data.Stream.StreamD as D
260−#if __GLASGOW_HASKELL__ == 802
261−import qualified Streamly.Internal.Data.Stream.StreamK as K
262−#endif
263260import qualified Streamly.Internal.Data.Stream.StreamK.Type as K
264261#ifdef USE_STREAMK_ONLY
265262import qualified Streamly.Internal.Data.Stream.StreamK as S
@@ -884,14 +881,8 @@ with f comb g = fmap snd . comb g . f
884881--
885882-- @since 0.1.0
886883{-# INLINE filter #-}
887−#if __GLASGOW_HASKELL__ != 802
888−-- GHC 8.2.2 crashes with this code, when used with "stack"
889884filter :: (IsStream t, Monad m) => (a -> Bool) -> t m a -> t m a
890885filter p m = fromStreamS $ S.filter p $ toStreamS m
891−#else
892−filter :: IsStream t => (a -> Bool) -> t m a -> t m a
893−filter p m = fromStream $ K.filter p $ toStream m
894−#endif
895886
896887-- | Same as 'filter' but with a monadic predicate.
897888--
src/Streamly/Internal/FileSystem/Event/Linux.hs−26
@@ -177,15 +177,7 @@ import Streamly.Internal.Data.Parser (Parser)
177177import Streamly.Internal.Data.Array.Foreign.Type (Array(..), byteLength)
178178import System.Directory (doesDirectoryExist)
179179import System.IO (Handle, hClose, IOMode(ReadMode))
180−#if !MIN_VERSION_base(4,10,0)
181−import Control.Concurrent.MVar (readMVar)
182−import Data.Typeable (cast)
183−import GHC.IO.Exception (IOException(..), IOErrorType(..), ioException)
184−import GHC.IO.FD (FD)
185−import GHC.IO.Handle.Types (Handle__(..), Handle(FileHandle, DuplexHandle))
186−#else
187180import GHC.IO.Handle.FD (handleToFd)
188−#endif
189181
190182import qualified Data.IntMap.Lazy as Map
191183import qualified Data.List.NonEmpty as NonEmpty
@@ -633,24 +625,6 @@ toUtf8 = A.fromStream . U.encodeUtf8 . S.fromList
633625utf8ToString :: Array Word8 -> String
634626utf8ToString = runIdentity . S.toList . U.decodeUtf8' . A.toStream
635627
636−#if !MIN_VERSION_base(4,10,0)
637−-- | Turn an existing Handle into a file descriptor. This function throws an
638−-- IOError if the Handle does not reference a file descriptor.
639−handleToFd :: Handle -> IO FD
640−handleToFd h = case h of
641− FileHandle _ mv -> do
642− Handle__{haDevice = dev} <- readMVar mv
643− case cast dev of
644− Just fd -> return fd
645− Nothing -> throwErr "not a file descriptor"
646− DuplexHandle{} -> throwErr "not a file handle"
647−
648− where
649−
650− throwErr msg = ioException $ IOError (Just h)
651− InappropriateType "handleToFd" msg Nothing Nothing
652−#endif
653−
654628-- | Add a trailing "/" at the end of the path if there is none. Do not add a
655629-- "/" if the path is empty.
656630--
src/Streamly/Internal/FileSystem/FDIO.hs−2
@@ -27,9 +27,7 @@ import Streamly.Internal.System.IOVec.Type (IOVec)
2727import Control.Concurrent (threadWaitWrite)
2828import Data.Int (Int64)
2929import Foreign.C.Error (throwErrnoIfMinus1RetryMayBlock)
30−#if __GLASGOW_HASKELL__ >= 802
3130import Foreign.C.Types (CBool(..))
32−#endif
3331import System.Posix.Internals (c_write, c_safe_write)
3432import Streamly.Internal.System.IOVec.Type (c_writev, c_safe_writev)
3533#endif
streamly.cabal+1−2
@@ -31,8 +31,7 @@ homepage: https://streamly.composewell.com
3131bug-reports: https://github.com/composewell/streamly/issues
3232license: BSD-3-Clause
3333license-file: LICENSE
34−tested-with: GHC==8.0.2
35− , GHC==8.4.4
34+tested-with: GHC==8.4.4
3635 , GHC==8.6.5
3736 , GHC==8.8.4
3837 , GHC==8.10.7
test/Streamly/Test/Data/List.hs−7
@@ -4,9 +4,6 @@
44
55module Main (main) where
66
7−#if !(MIN_VERSION_base(4,11,0))
8−import Data.Semigroup ((<>))
9−#endif
107import Test.Hspec
118import qualified GHC.Exts as GHC
129
@@ -148,11 +145,7 @@ main = hspec $
148145 ("hello" :: List Char) `shouldBe` GHC.fromList "hello"
149146
150147 it "pattern matches" $ do
151−#if __GLASGOW_HASKELL__ >= 802
152148 case "" of
153−#else
154− case "" :: List Char of
155−#endif
156149 Nil -> return ()
157150 _ -> expectationFailure "not reached"
158151
test/Streamly/Test/Prelude.hs−3
@@ -15,9 +15,6 @@ import Control.Monad.Catch (throwM)
1515import Control.Monad.Error.Class (throwError, MonadError)
1616import Control.Monad.Trans.Except (runExceptT, ExceptT)
1717import Data.List (sort)
18−#if !(MIN_VERSION_base(4,11,0))
19−import Data.Semigroup (Semigroup(..))
20−#endif
2118import System.IO (stdout, hSetBuffering, BufferMode(LineBuffering))
2219import System.Random (randomIO)
2320import Test.Hspec as H
test/Streamly/Test/Prelude/Concurrent.hs−3
@@ -21,9 +21,6 @@ import Control.Monad.State (MonadState, get, modify, runStateT
2121 , StateT(..), evalStateT)
2222import Data.Foldable (fold)
2323import Data.IORef (readIORef, modifyIORef, newIORef)
24−#if !(MIN_VERSION_base(4,11,0))
25−import Data.Semigroup (Semigroup, (<>))
26−#endif
2724import GHC.Word (Word8)
2825import Test.Hspec.QuickCheck
2926import Test.Hspec as H
test/Streamly/Test/Prelude/Parallel.hs−3
@@ -10,9 +10,6 @@
1010module Streamly.Test.Prelude.Parallel (main) where
1111
1212import Data.List (sort)
13−#if !(MIN_VERSION_base(4,11,0))
14−import Data.Semigroup ((<>))
15−#endif
1613import Test.Hspec.QuickCheck
1714import Test.Hspec as H
1815
test/Streamly/Test/Prelude/WAsync.hs−3
@@ -13,9 +13,6 @@ module Streamly.Test.Prelude.WAsync (main) where
1313import Control.Concurrent ( threadDelay )
1414#endif
1515import Data.List (sort)
16−#if !(MIN_VERSION_base(4,11,0))
17−import Data.Semigroup ((<>))
18−#endif
1916import Test.Hspec.QuickCheck
2017import Test.QuickCheck (Property, withMaxSuccess)
2118import Test.QuickCheck.Monadic (monadicIO, run)
test/Streamly/Test/Unicode/Char.hs−8
@@ -16,9 +16,6 @@ module Streamly.Test.Unicode.Char (main) where
1616import Control.Monad (when)
1717import Data.Char (chr, isSpace, ord, toUpper)
1818import Data.List (intercalate, isPrefixOf)
19−#if MIN_VERSION_base(4,8,0)
20−import Data.Function ((&))
21−#endif
2219import Streamly.Internal.Unicode.Char
2320 ( NormalizationMode(NFC, NFD, NFKC, NFKD)
2421 , normalize
@@ -31,11 +28,6 @@ import qualified Streamly.Internal.Data.Stream.IsStream as S
3128import qualified Streamly.Internal.Data.Fold as FL
3229import qualified System.Directory as Dir
3330
34−#if !MIN_VERSION_base(4,8,0)
35−(&) :: a -> (a -> b) -> b
36−x & f = f x
37−#endif
38−
3931chrToHex :: Char -> [Char]
4032chrToHex = map toUpper . printf "%.4x" . ord
4133
test/lib/Streamly/Test/Prelude/Common.hs−6
@@ -117,9 +117,6 @@ import Data.List
117117 , unfoldr
118118 )
119119import Data.Maybe (mapMaybe)
120−#if !(MIN_VERSION_base(4,11,0))
121−import Data.Semigroup (Semigroup, (<>))
122−#endif
123120import GHC.Word (Word8)
124121import System.Mem (performMajorGC)
125122import Test.Hspec.QuickCheck
@@ -972,9 +969,6 @@ nestTwoStreamsApp desc streamListT listT t =
972969composeAndComposeSimple
973970 :: ( IsStream t1, Semigroup (t1 IO Int)
974971 , IsStream t2, Monoid (t2 IO Int), Monad (t2 IO)
975−#if !(MIN_VERSION_base(4,11,0))
976− , Semigroup (t2 IO Int)
977−#endif
978972 )
979973 => (t1 IO Int -> SerialT IO Int)
980974 -> (t2 IO Int -> t2 IO Int)