@@ -26,7 +26,7 @@ module Streamly.Internal.Data.Parser.Chunked.Type
2626 (
2727 Step (..)
2828 , ParseResult (..)
29− , ParserChunked (..)
29+ , ChunkParser (..)
3030 , fromPure
3131 , fromEffect
3232 , die
@@ -98,7 +98,7 @@ instance Functor ParseResult where
9898-- input without a result or return a result with no further input to be
9999-- consumed.
100100--
101−newtype ParserChunked a m b = MkParser
101+newtype ChunkParser a m b = MkParser
102102 { runParser :: forall r.
103103 -- XXX Maintain and pass the original position in the stream. that
104104 -- way we can also report better errors. Use a Context structure for
@@ -130,7 +130,7 @@ newtype ParserChunked a m b = MkParser
130130-- XXX rewrite this using ParserD, expose rmapM from ParserD.
131131-- | Maps a function over the output of the parser.
132132--
133−instance Functor m => Functor (ParserChunked a m) where
133+instance Functor m => Functor (ChunkParser a m) where
134134 {-# INLINE fmap #-}
135135 fmap f parser = MkParser $ \n st arr pk ->
136136 let pk1 res = pk (fmap f res)
@@ -147,7 +147,7 @@ instance Functor m => Functor (ParserChunked a m) where
147147-- /Pre-release/
148148--
149149{-# INLINE fromPure #-}
150−fromPure :: b -> ParserChunked a m b
150+fromPure :: b -> ChunkParser a m b
151151fromPure b = MkParser $ \n st arr pk -> pk (Success n b) st arr
152152
153153-- | See 'Streamly.Internal.Data.Parser.fromEffect'.
@@ -155,7 +155,7 @@ fromPure b = MkParser $ \n st arr pk -> pk (Success n b) st arr
155155-- /Pre-release/
156156--
157157{-# INLINE fromEffect #-}
158−fromEffect :: Monad m => m b -> ParserChunked a m b
158+fromEffect :: Monad m => m b -> ChunkParser a m b
159159fromEffect eff =
160160 MkParser $ \n st arr pk -> eff >>= \b -> pk (Success n b) st arr
161161
@@ -163,7 +163,7 @@ fromEffect eff =
163163-- this operation does not fuse, use 'Streamly.Internal.Data.Parser.serialWith'
164164-- when fusion is important.
165165--
166−instance Monad m => Applicative (ParserChunked a m) where
166+instance Monad m => Applicative (ChunkParser a m) where
167167 {-# INLINE pure #-}
168168 pure = fromPure
169169
@@ -200,7 +200,7 @@ instance Monad m => Applicative (ParserChunked a m) where
200200-- /Pre-release/
201201--
202202{-# INLINE die #-}
203−die :: String -> ParserChunked a m b
203+die :: String -> ChunkParser a m b
204204die err = MkParser (\n st arr pk -> pk (Failure n err) st arr)
205205
206206-- | Monad composition can be used for lookbehind parsers, we can make the
@@ -245,7 +245,7 @@ die err = MkParser (\n st arr pk -> pk (Failure n err) st arr)
245245-- does not fuse, use 'Streamly.Internal.Data.Parser.concatMap' when you need
246246-- fusion.
247247--
248−instance Monad m => Monad (ParserChunked a m) where
248+instance Monad m => Monad (ChunkParser a m) where
249249 {-# INLINE return #-}
250250 return = pure
251251
@@ -264,11 +264,11 @@ instance Monad m => Monad (ParserChunked a m) where
264264 {-# INLINE fail #-}
265265 fail = die
266266#endif
267−instance Monad m => Fail.MonadFail (ParserChunked a m) where
267+instance Monad m => Fail.MonadFail (ChunkParser a m) where
268268 {-# INLINE fail #-}
269269 fail = die
270270
271−instance MonadIO m => MonadIO (ParserChunked a m) where
271+instance MonadIO m => MonadIO (ChunkParser a m) where
272272 {-# INLINE liftIO #-}
273273 liftIO = fromEffect . liftIO
274274
@@ -289,7 +289,7 @@ instance MonadIO m => MonadIO (ParserChunked a m) where
289289-- does not fuse, use 'Streamly.Internal.Data.Parser.alt' when you need
290290-- fusion.
291291--
292−instance Monad m => Alternative (ParserChunked a m) where
292+instance Monad m => Alternative (ChunkParser a m) where
293293 {-# INLINE empty #-}
294294 empty = die "empty"
295295
@@ -322,7 +322,7 @@ instance Monad m => Alternative (ParserChunked a m) where
322322-- | 'mzero' is same as 'empty', it aborts the parser. 'mplus' is same as
323323-- '<|>', it selects the first succeeding parser.
324324--
325−instance Monad m => MonadPlus (ParserChunked a m) where
325+instance Monad m => MonadPlus (ChunkParser a m) where
326326 {-# INLINE mzero #-}
327327 mzero = die "mzero"
328328