@@ -12,6 +12,10 @@
1212{-# LANGUAGE RankNTypes #-}
1313{-# LANGUAGE MagicHash #-}
1414
15+#if __GLASGOW_HASKELL__ >= 801
16+{-# LANGUAGE TypeApplications #-}
17+#endif
18+
1519#include "inline.hs"
1620
1721-- |
@@ -255,6 +259,9 @@ import Control.Monad.Catch (MonadCatch)
255259import Control.Monad.IO.Class (MonadIO(..))
256260import Control.Monad.Trans (MonadTrans(lift))
257261import Data.Bits (shiftR, shiftL, (.|.), (.&.))
262+#if __GLASGOW_HASKELL__ >= 801
263+import Data.Functor.Identity (Identity)
264+#endif
258265import Data.Maybe (fromJust, isJust)
259266import Data.Word (Word32)
260267import Foreign.Ptr (Ptr)
@@ -2352,8 +2359,10 @@ zipWithM f (Stream stepa ta) (Stream stepb tb) = Stream step (ta, tb, Nothing)
23522359 Skip sb' -> return $ Skip (sa, sb', Just x)
23532360 Stop -> return Stop
23542361
2362+#if __GLASGOW_HASKELL__ >= 801
23552363{-# 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
23572366
23582367{-# INLINE zipWith #-}
23592368zipWith :: Monad m => (a -> b -> c) -> Stream m a -> Stream m b -> Stream m c