@@ -11,7 +11,10 @@
11{-# LANGUAGE ViewPatterns #-}
11{-# LANGUAGE ViewPatterns #-}
12{-# LANGUAGE RankNTypes #-}
12{-# LANGUAGE RankNTypes #-}
13{-# LANGUAGE MagicHash #-}
13{-# LANGUAGE MagicHash #-}
15+#if __GLASGOW_HASKELL__ >= 801
14{-# LANGUAGE TypeApplications #-}
16{-# LANGUAGE TypeApplications #-}
16#include "inline.hs"
19#include "inline.hs"
@@ -256,7 +259,9 @@ import Control.Monad.Catch (MonadCatch)
256import Control.Monad.IO.Class (MonadIO(..))
259import Control.Monad.IO.Class (MonadIO(..))
257import Control.Monad.Trans (MonadTrans(lift))
260import Control.Monad.Trans (MonadTrans(lift))
258import Data.Bits (shiftR, shiftL, (.|.), (.&.))
261import Data.Bits (shiftR, shiftL, (.|.), (.&.))
262+#if __GLASGOW_HASKELL__ >= 801
259import Data.Functor.Identity (Identity)
263import Data.Functor.Identity (Identity)
260import Data.Maybe (fromJust, isJust)
265import Data.Maybe (fromJust, isJust)
261import Data.Word (Word32)
266import Data.Word (Word32)
262import Foreign.Ptr (Ptr)
267import Foreign.Ptr (Ptr)
@@ -2354,8 +2359,10 @@ zipWithM f (Stream stepa ta) (Stream stepb tb) = Stream step (ta, tb, Nothing)
2354 Skip sb' -> return $ Skip (sa, sb', Just x)
2359 Skip sb' -> return $ Skip (sa, sb', Just x)
2355 Stop -> return Stop
2360 Stop -> return Stop
2362+#if __GLASGOW_HASKELL__ >= 801
2357{-# RULES "zipWithM xs xs"
2363{-# RULES "zipWithM xs xs"
2358 forall f xs. zipWithM @Identity f xs xs = mapM (\x -> f x x) xs #-}
2364 forall f xs. zipWithM @Identity f xs xs = mapM (\x -> f x x) xs #-}
2360{-# INLINE zipWith #-}
2367{-# INLINE zipWith #-}
2361zipWith :: 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