@@ -33,7 +33,7 @@
33-- 1. Buffer the input until explicitly asked to drop the input
33-- 1. Buffer the input until explicitly asked to drop the input
34-- 2. Drop the input stream beyond a "point of no return" in the history
34-- 2. Drop the input stream beyond a "point of no return" in the history
35-- because the input till that point has been consumed irrevocably.
35-- because the input till that point has been consumed irrevocably.
36−-- 2. Go back in the buffered stream upto the point of no return.
36+-- 3. Go back in the buffered stream upto the point of no return.
38-- Based on application requirements it should be possible to design even a
38-- Based on application requirements it should be possible to design even a
39-- richer interface to manipulate the input stream/buffer. For example, we
39-- richer interface to manipulate the input stream/buffer. For example, we
@@ -106,7 +106,7 @@ data Parser m a b =
107-- | Maps a function over the output of the fold.
107-- | Maps a function over the output of the fold.
109−instance Monad m => Functor (Parser m a) where
109+instance Functor m => Functor (Parser m a) where
110 {-# INLINE fmap #-}
110 {-# INLINE fmap #-}
111 fmap f (Parser step initial extract) =
111 fmap f (Parser step initial extract) =
112 Parser step initial (fmap3 f extract)
112 Parser step initial (fmap3 f extract)
@@ -115,9 +115,6 @@ instance Monad m => Functor (Parser m a) where
116 fmap3 g = fmap (fmap (fmap g))
116 fmap3 g = fmap (fmap (fmap g))
119− (<$) b = \_ -> pure b
121{-# ANN type SeqParseState Fuse #-}
118{-# ANN type SeqParseState Fuse #-}
122data SeqParseState sl f sr =
119data SeqParseState sl f sr =
123 SeqParseL sl | SeqParseR f sr | SeqParseLErr String
120 SeqParseL sl | SeqParseR f sr | SeqParseLErr String