on master help sign in
Merge pull request #233 from composewell/fixrules
476a85aHarendra Kumar
src/Streamly/Streams/Instances.hs+1
@@ -108,6 +108,7 @@ instance (a ~ Char) => IsString (STREAM Identity a) where { \
108 fromString = P.fromList }; \
108 fromString = P.fromList }; \
109 \
109 \
110instance NFData a => NFData (STREAM Identity a) where { \
110instance NFData a => NFData (STREAM Identity a) where { \
111+ {-# INLINE rnf #-}; \
111 rnf = runIdentity . P.foldl' (\_ x -> rnf x) () }; \
112 rnf = runIdentity . P.foldl' (\_ x -> rnf x) () }; \
112
113
113-------------------------------------------------------------------------------
114-------------------------------------------------------------------------------
src/Streamly/Streams/StreamD.hs+10−1
@@ -12,6 +12,10 @@
12{-# LANGUAGE RankNTypes #-}
12{-# LANGUAGE RankNTypes #-}
13{-# LANGUAGE MagicHash #-}
13{-# LANGUAGE MagicHash #-}
14
14
15+#if __GLASGOW_HASKELL__ >= 801
16+{-# LANGUAGE TypeApplications #-}
17+#endif
18+
15#include "inline.hs"
19#include "inline.hs"
16
20
17-- |
21-- |
@@ -255,6 +259,9 @@ import Control.Monad.Catch (MonadCatch)
255import Control.Monad.IO.Class (MonadIO(..))
259import Control.Monad.IO.Class (MonadIO(..))
256import Control.Monad.Trans (MonadTrans(lift))
260import Control.Monad.Trans (MonadTrans(lift))
257import Data.Bits (shiftR, shiftL, (.|.), (.&.))
261import Data.Bits (shiftR, shiftL, (.|.), (.&.))
262+#if __GLASGOW_HASKELL__ >= 801
263+import Data.Functor.Identity (Identity)
264+#endif
258import Data.Maybe (fromJust, isJust)
265import Data.Maybe (fromJust, isJust)
259import Data.Word (Word32)
266import Data.Word (Word32)
260import Foreign.Ptr (Ptr)
267import Foreign.Ptr (Ptr)
@@ -2352,8 +2359,10 @@ zipWithM f (Stream stepa ta) (Stream stepb tb) = Stream step (ta, tb, Nothing)
2352 Skip sb' -> return $ Skip (sa, sb', Just x)
2359 Skip sb' -> return $ Skip (sa, sb', Just x)
2353 Stop -> return Stop
2360 Stop -> return Stop
2354
2361
2362+#if __GLASGOW_HASKELL__ >= 801
2355{-# RULES "zipWithM xs xs"
2363{-# RULES "zipWithM xs xs"
2356− forall f xs. zipWithM f xs xs = mapM (\x -> f x x) xs #-}
2364+ forall f xs. zipWithM @Identity f xs xs = mapM (\x -> f x x) xs #-}
2365+#endif
2357
2366
2358{-# INLINE zipWith #-}
2367{-# INLINE zipWith #-}
2359zipWith :: Monad m => (a -> b -> c) -> Stream m a -> Stream m b -> Stream m c
2368zipWith :: Monad m => (a -> b -> c) -> Stream m a -> Stream m b -> Stream m c