on master help sign in
Use substream functions from StreamD not the imported Stream.
9ccee33Pranay Sashank
src/Streamly/Prelude.hs+3−3
@@ -801,7 +801,7 @@ elemIndex a = findIndex (==a)
801--
801--
802{-# INLINE isPrefixOf #-}
802{-# INLINE isPrefixOf #-}
803isPrefixOf :: (Eq a, IsStream t, Monad m) => t m a -> t m a -> m Bool
803isPrefixOf :: (Eq a, IsStream t, Monad m) => t m a -> t m a -> m Bool
804−isPrefixOf m1 m2 = S.isPrefixOf (toStreamD m1) (toStreamD m2)
804+isPrefixOf m1 m2 = D.isPrefixOf (toStreamD m1) (toStreamD m2)
805
805
806-- | Takes two streams and returns 'True' if all the elements of the
806-- | Takes two streams and returns 'True' if all the elements of the
807-- first stream occur, in order, in the second stream. The elements do
807-- first stream occur, in order, in the second stream. The elements do
@@ -809,7 +809,7 @@ isPrefixOf m1 m2 = S.isPrefixOf (toStreamD m1) (toStreamD m2)
809--
809--
810{-# INLINE isSubsequenceOf #-}
810{-# INLINE isSubsequenceOf #-}
811isSubsequenceOf :: (Eq a, IsStream t, Monad m) => t m a -> t m a -> m Bool
811isSubsequenceOf :: (Eq a, IsStream t, Monad m) => t m a -> t m a -> m Bool
812−isSubsequenceOf m1 m2 = S.isSubsequenceOf (toStreamD m1) (toStreamD m2)
812+isSubsequenceOf m1 m2 = D.isSubsequenceOf (toStreamD m1) (toStreamD m2)
813
813
814-- | Drops the given prefix from a stream. Returns Nothing if the stream
814-- | Drops the given prefix from a stream. Returns Nothing if the stream
815-- doesn't start with the prefix given.
815-- doesn't start with the prefix given.
@@ -817,7 +817,7 @@ isSubsequenceOf m1 m2 = S.isSubsequenceOf (toStreamD m1) (toStreamD m2)
817{-# INLINE stripPrefix #-}
817{-# INLINE stripPrefix #-}
818stripPrefix :: (Eq a, IsStream t, Monad m) => t m a -> t m a -> m (Maybe (t m a))
818stripPrefix :: (Eq a, IsStream t, Monad m) => t m a -> t m a -> m (Maybe (t m a))
819stripPrefix m1 m2 = fmap (fmap fromStreamD) $
819stripPrefix m1 m2 = fmap (fmap fromStreamD) $
820− S.stripPrefix (toStreamD m1) (toStreamD m2)
820+ D.stripPrefix (toStreamD m1) (toStreamD m2)
821
821
822------------------------------------------------------------------------------
822------------------------------------------------------------------------------
823-- Map and Fold
823-- Map and Fold