on master help sign in
Fix GHC 7.10.3 build
commitd38ab548f6551b863d3199a70753f03d51ef5563 authorHarendra Kumar <harendra.kumar@gmail.com> dateTue 18 Feb 2020, 23:55 (7 years ago) parent007df99
4 files changed+34−14
src/Streamly/Internal/BaseCompat.hs+29 src/Streamly/Internal/Data/Stream/Serial.hs+2−7 src/Streamly/Internal/Data/Stream/Zip.hs+2−7 streamly.cabal+1
src/Streamly/Internal/BaseCompat.hsnew file+29
@@ -0,0 +1,29 @@
1+{-# LANGUAGE CPP #-}
2+
3+-- |
4+-- Module : Streamly.Internal.BaseCompat
5+-- License : BSD3
6+-- Maintainer : streamly@composewell.com
7+-- Stability : experimental
8+-- Portability : GHC
9+--
10+-- Compatibility functions for "base" package.
11+--
12+module Streamly.Internal.BaseCompat
13+ (
14+ (#.)
15+ , errorWithoutStackTrace
16+ )
17+where
18+
19+import Data.Coerce (Coercible, coerce)
20+
21+{-# INLINE (#.) #-}
22+(#.) :: Coercible b c => (b -> c) -> (a -> b) -> (a -> c)
23+(#.) _f = coerce
24+
25+#if !(MIN_VERSION_base(4,9,0))
26+{-# NOINLINE errorWithoutStackTrace #-}
27+errorWithoutStackTrace :: [Char] -> a
28+errorWithoutStackTrace s = error s
29+#endif
src/Streamly/Internal/Data/Stream/Serial.hs+2−7
@@ -61,7 +61,6 @@ import Control.Monad.IO.Class (MonadIO(..))
6161import Control.Monad.Reader.Class (MonadReader(..))
6262import Control.Monad.State.Class (MonadState(..))
6363import Control.Monad.Trans.Class (MonadTrans(lift))
64−import Data.Coerce (Coercible, coerce)
6564import Data.Foldable (Foldable(foldl'), fold)
6665import Data.Functor.Identity (Identity(..), runIdentity)
6766import Data.Maybe (fromMaybe)
@@ -72,8 +71,9 @@ import Data.Semigroup (Semigroup(..))
7271import GHC.Exts (IsList(..), IsString(..))
7372import Text.Read (Lexeme(Ident), lexP, parens, prec, readPrec, readListPrec,
7473 readListPrecDefault)
75−import Prelude hiding (map, mapM)
74+import Prelude hiding (map, mapM, errorWithoutStackTrace)
7675
76+import Streamly.Internal.BaseCompat ((#.), errorWithoutStackTrace)
7777import Streamly.Internal.Data.Stream.StreamK (IsStream(..), adapt, Stream, mkStream,
7878 foldStream)
7979import Streamly.Internal.Data.Strict (Maybe'(..), toMaybe)
@@ -84,11 +84,6 @@ import qualified Streamly.Internal.Data.Stream.StreamD as D
8484#include "Instances.hs"
8585#include "inline.hs"
8686
87−-- XXX move this to Streamly.Internal.Data.Coerce?
88−{-# INLINE (#.) #-}
89−(#.) :: Coercible b c => (b -> c) -> (a -> b) -> (a -> c)
90−(#.) _f = coerce
91−
9287------------------------------------------------------------------------------
9388-- SerialT
9489------------------------------------------------------------------------------
src/Streamly/Internal/Data/Stream/Zip.hs+2−7
@@ -45,7 +45,6 @@ import Control.DeepSeq (NFData(..))
4545#if MIN_VERSION_deepseq(1,4,3)
4646import Control.DeepSeq (NFData1(..))
4747#endif
48−import Data.Coerce (Coercible, coerce)
4948import Data.Foldable (Foldable(foldl'), fold)
5049import Data.Functor.Identity (Identity(..), runIdentity)
5150import Data.Maybe (fromMaybe)
@@ -56,8 +55,9 @@ import Data.Semigroup (Semigroup(..))
5655import GHC.Exts (IsList(..), IsString(..))
5756import Text.Read (Lexeme(Ident), lexP, parens, prec, readPrec, readListPrec,
5857 readListPrecDefault)
59−import Prelude hiding (map, repeat, zipWith)
58+import Prelude hiding (map, repeat, zipWith, errorWithoutStackTrace)
6059
60+import Streamly.Internal.BaseCompat ((#.), errorWithoutStackTrace)
6161import Streamly.Internal.Data.Stream.StreamK (IsStream(..), Stream)
6262import Streamly.Internal.Data.Strict (Maybe'(..), toMaybe)
6363import Streamly.Internal.Data.SVar (MonadAsync)
@@ -74,11 +74,6 @@ import qualified Streamly.Internal.Data.Stream.StreamD as S
7474
7575#include "Instances.hs"
7676
77−-- XXX move this to Streamly.Internal.Data.Coerce?
78−{-# INLINE (#.) #-}
79−(#.) :: Coercible b c => (b -> c) -> (a -> b) -> (a -> c)
80−(#.) _f = coerce
81−
8277-- | Like 'zipWith' but using a monadic zipping function.
8378--
8479-- @since 0.4.0
streamly.cabal+1
@@ -322,6 +322,7 @@ library
322322 , Streamly.Tutorial
323323
324324 -- Internal modules
325+ , Streamly.Internal.BaseCompat
325326 , Streamly.Internal.Control.Monad
326327 , Streamly.Internal.Data.Strict
327328 , Streamly.Internal.Data.Atomics