on master help sign in
Fix build for older versions of GHC
commitb90107f15bdbf0d76a43349293b4654368380daf authorHarendra Kumar <harendra@composewell.com> dateWed 3 Jun 2020, 21:11 (6 years ago) parentf00b571
2 files changed+14−3
benchmark/lib/Streamly/Benchmark/Prelude.hs+1−1 src/Streamly/Internal/Data/Fold.hs+13−2
benchmark/lib/Streamly/Benchmark/Prelude.hs+1−1
@@ -264,7 +264,7 @@ sourceFromFoldableM :: (S.IsStream t, S.MonadAsync m) => Int -> Int -> t m Int
264264sourceFromFoldableM value n = S.fromFoldableM (P.fmap return [n..n+value])
265265
266266{-# INLINE absTimes #-}
267−absTimes :: (S.IsStream t, S.MonadAsync m)
267+absTimes :: (S.IsStream t, S.MonadAsync m, P.Functor (t m))
268268 => Int -> Int -> t m AbsTime
269269absTimes value _ = S.take value $ Internal.absTimes
270270
src/Streamly/Internal/Data/Fold.hs+13−2
@@ -215,6 +215,9 @@ import Control.Monad.IO.Class (MonadIO(..))
215215import Data.Functor.Identity (Identity(..))
216216import Data.Int (Int64)
217217import Data.Map.Strict (Map)
218+#if __GLASGOW_HASKELL__ < 804
219+import Data.Semigroup (Semigroup((<>)))
220+#endif
218221
219222import Prelude
220223 hiding (filter, drop, dropWhile, take, takeWhile, zipWith,
@@ -629,7 +632,11 @@ sconcat i = Fold (\x a -> return $ x <> a) (return i) return
629632--
630633-- @since 0.7.0
631634{-# INLINE mconcat #-}
632−mconcat :: (Monad m, Monoid a) => Fold m a a
635+mconcat :: (Monad m, Monoid a
636+#if __GLASGOW_HASKELL__ < 804
637+ , Semigroup a
638+#endif
639+ ) => Fold m a a
633640mconcat = sconcat mempty
634641
635642-- |
@@ -642,7 +649,11 @@ mconcat = sconcat mempty
642649--
643650-- @since 0.7.0
644651{-# INLINABLE foldMap #-}
645−foldMap :: (Monad m, Monoid b) => (a -> b) -> Fold m a b
652+foldMap :: (Monad m, Monoid b
653+#if __GLASGOW_HASKELL__ < 804
654+ , Semigroup b
655+#endif
656+ ) => (a -> b) -> Fold m a b
646657foldMap f = lmap f mconcat
647658
648659-- |