@@ -12,6 +12,10 @@
12{-# LANGUAGE RankNTypes #-}
12{-# LANGUAGE RankNTypes #-}
13{-# LANGUAGE MagicHash #-}
13{-# LANGUAGE MagicHash #-}
15+#if __GLASGOW_HASKELL__ >= 801
16+{-# LANGUAGE TypeApplications #-}
15#include "inline.hs"
19#include "inline.hs"
@@ -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)
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
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 #-}
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