@@ -19,12 +19,6 @@ module Streamly.Internal.Data.Parser
1919 module Streamly.Internal.Data.Parser.Type
2020 -- , module Streamly.Internal.Data.Parser.Tee
2121
22- -- * Types
23- , Parser (.. )
24- , ParseError (.. )
25- , Step (.. )
26- , Initial (.. )
27-
2822 -- * Downgrade to Fold
2923 , toFold
3024
@@ -618,7 +612,7 @@ data Tuple'Fused a b = Tuple'Fused !a !b deriving Show
618612-- Right [1,2]
619613--
620614-- >>> takeBetween' 2 4 [1]
621- -- Left (ParseError 1 "takeBetween: Expecting alteast 2 elements, got 1")
615+ -- Left (ParseErrorPos 1 "takeBetween: Expecting alteast 2 elements, got 1")
622616--
623617-- >>> takeBetween' 0 0 [1, 2]
624618-- Right []
@@ -724,7 +718,7 @@ takeBetween low high (Fold fstep finitial _ ffinal) =
724718-- Right [1,0]
725719--
726720-- >>> Stream.parsePos (Parser.takeEQ 4 Fold.toList) $ Stream.fromList [1,0,1]
727- -- Left (ParseError 3 "takeEQ: Expecting exactly 4 elements, input terminated on 3")
721+ -- Left (ParseErrorPos 3 "takeEQ: Expecting exactly 4 elements, input terminated on 3")
728722--
729723{-# INLINE takeEQ #-}
730724takeEQ :: Monad m => Int -> Fold m a b -> Parser a m b
@@ -785,7 +779,7 @@ data TakeGEState s =
785779-- elements.
786780--
787781-- >>> Stream.parsePos (Parser.takeGE 4 Fold.toList) $ Stream.fromList [1,0,1]
788- -- Left (ParseError 3 "takeGE: Expecting at least 4 elements, input terminated on 3")
782+ -- Left (ParseErrorPos 3 "takeGE: Expecting at least 4 elements, input terminated on 3")
789783--
790784-- >>> Stream.parse (Parser.takeGE 4 Fold.toList) $ Stream.fromList [1,0,1,0,1]
791785-- Right [1,0,1,0,1]
@@ -1325,7 +1319,7 @@ takeEitherSepBy _cond = undefined -- D.toParserK . D.takeEitherSepBy cond
13251319-- >>> p = Parser.takeBeginBy (== ',') Fold.toList
13261320-- >>> leadingComma = Stream.parsePos p . Stream.fromList
13271321-- >>> leadingComma "a,b"
1328- -- Left (ParseError 1 "takeBeginBy: missing frame start")
1322+ -- Left (ParseErrorPos 1 "takeBeginBy: missing frame start")
13291323-- ...
13301324-- >>> leadingComma ",,"
13311325-- Right ","
@@ -1403,7 +1397,7 @@ RENAME(takeStartBy_,takeBeginBy_)
14031397-- >>> Stream.parse p $ Stream.fromList "{hello \\{world}"
14041398-- Right "hello {world"
14051399-- >>> Stream.parsePos p $ Stream.fromList "{hello {world}"
1406- -- Left (ParseError 14 "takeFramedByEsc_: missing frame end")
1400+ -- Left (ParseErrorPos 14 "takeFramedByEsc_: missing frame end")
14071401--
14081402-- /Pre-release/
14091403{-# INLINE takeFramedByEsc_ #-}
@@ -2146,7 +2140,7 @@ groupByRollingEither
21462140-- Right "string"
21472141--
21482142-- >>> Stream.parsePos (Parser.listEqBy (==) "mismatch") $ Stream.fromList "match"
2149- -- Left (ParseError 2 "streamEqBy: mismtach occurred")
2143+ -- Left (ParseErrorPos 2 "streamEqBy: mismtach occurred")
21502144--
21512145{-# INLINE listEqBy #-}
21522146listEqBy :: Monad m => (a -> a -> Bool ) -> [a ] -> Parser a m [a ]
@@ -2437,7 +2431,7 @@ spanByRolling eq f1 f2 =
24372431-- Right [1,2]
24382432--
24392433-- >>> Stream.parsePos (Parser.takeP 4 (Parser.takeEQ 5 Fold.toList)) $ Stream.fromList [1, 2, 3, 4, 5]
2440- -- Left (ParseError 4 "takeEQ: Expecting exactly 5 elements, input terminated on 4")
2434+ -- Left (ParseErrorPos 4 "takeEQ: Expecting exactly 5 elements, input terminated on 4")
24412435--
24422436-- /Internal/
24432437{-# INLINE takeP #-}
@@ -2591,7 +2585,7 @@ data DeintercalateAllState fs sp ss =
25912585-- >>> Stream.parse p $ Stream.fromList "1"
25922586-- Right [Left "1"]
25932587-- >>> Stream.parsePos p $ Stream.fromList "1+"
2594- -- Left (ParseError 2 "takeWhile1: end of input")
2588+ -- Left (ParseErrorPos 2 "takeWhile1: end of input")
25952589-- >>> Stream.parse p $ Stream.fromList "1+2+3"
25962590-- Right [Left "1",Right '+',Left "2",Right '+',Left "3"]
25972591--
@@ -2867,7 +2861,7 @@ data Deintercalate1State b fs sp ss =
28672861-- >>> p2 = Parser.satisfy (== '+')
28682862-- >>> p = Parser.deintercalate1 p1 p2 Fold.toList
28692863-- >>> Stream.parsePos p $ Stream.fromList ""
2870- -- Left (ParseError 0 "takeWhile1: end of input")
2864+ -- Left (ParseErrorPos 0 "takeWhile1: end of input")
28712865-- >>> Stream.parse p $ Stream.fromList "1"
28722866-- Right [Left "1"]
28732867-- >>> Stream.parse p $ Stream.fromList "1+"
@@ -3160,7 +3154,7 @@ sepBy1 p sep sink = do
31603154-- >>> p2 = Parser.satisfy (== '+')
31613155-- >>> p = Parser.sepBy1 p1 p2 Fold.toList
31623156-- >>> Stream.parsePos p $ Stream.fromList ""
3163- -- Left (ParseError 0 "takeWhile1: end of input")
3157+ -- Left (ParseErrorPos 0 "takeWhile1: end of input")
31643158-- >>> Stream.parse p $ Stream.fromList "1"
31653159-- Right ["1"]
31663160-- >>> Stream.parse p $ Stream.fromList "1+"
0 commit comments