@@ -11,7 +11,10 @@
1111{-# LANGUAGE ViewPatterns #-}
1212{-# LANGUAGE RankNTypes #-}
1313{-# LANGUAGE MagicHash #-}
14+
15+#if __GLASGOW_HASKELL__ >= 801
1416{-# LANGUAGE TypeApplications #-}
17+#endif
1518
1619#include "inline.hs"
1720
@@ -256,7 +259,9 @@ import Control.Monad.Catch (MonadCatch)
256259import Control.Monad.IO.Class (MonadIO(..))
257260import Control.Monad.Trans (MonadTrans(lift))
258261import Data.Bits (shiftR, shiftL, (.|.), (.&.))
262+#if __GLASGOW_HASKELL__ >= 801
259263import Data.Functor.Identity (Identity)
264+#endif
260265import Data.Maybe (fromJust, isJust)
261266import Data.Word (Word32)
262267import Foreign.Ptr (Ptr)
@@ -2354,8 +2359,10 @@ zipWithM f (Stream stepa ta) (Stream stepb tb) = Stream step (ta, tb, Nothing)
23542359 Skip sb' -> return $ Skip (sa, sb', Just x)
23552360 Stop -> return Stop
23562361
2362+#if __GLASGOW_HASKELL__ >= 801
23572363{-# RULES "zipWithM xs xs"
23582364 forall f xs. zipWithM @Identity f xs xs = mapM (\x -> f x x) xs #-}
2365+#endif
23592366
23602367{-# INLINE zipWith #-}
23612368zipWith :: Monad m => (a -> b -> c) -> Stream m a -> Stream m b -> Stream m c