@@ -723,7 +723,7 @@ takeEndByEsc isEsc isSep (Parser pstep pinitial pextract) =
723723
724724 extract (Left' s) = pextract s
725725 extract (Right' _) =
726− throwM $ ParseError "takeEndByEsc: trailing escape, end of input"
726+ throwM $ ParseError "takeEndByEsc: trailing escape"
727727
728728-- | See 'Streamly.Internal.Data.Parser.takeEndBy_'.
729729--
@@ -765,7 +765,7 @@ takeStartBy cond (Fold fstep finitial fextract) =
765765 return $
766766 case res of
767767 FL.Partial s -> IPartial (Left' s)
768− FL.Done _ -> IError "takeStartBy : bad finitial"
768+ FL.Done _ -> IError "takeStartBy: fold done without input"
769769
770770 {-# INLINE process #-}
771771 process s a = do
@@ -778,8 +778,7 @@ takeStartBy cond (Fold fstep finitial fextract) =
778778 step (Left' s) a =
779779 if cond a
780780 then process s a
781− else error $ "takeStartBy : token begins with an element which "
782− ++ "fails the predicate"
781+ else return $ Error "takeStartBy: missing frame start"
783782 step (Right' s) a =
784783 if not (cond a)
785784 then process s a
@@ -1342,7 +1341,7 @@ deintercalate
13421341 where
13431342
13441343 errMsg p status =
1345− error $ "sepBy: " ++ p ++ " parser cannot "
1344+ error $ "deintercalate: " ++ p ++ " parser cannot "
13461345 ++ status ++ " without input"
13471346
13481347 initial = do
@@ -1392,7 +1391,7 @@ deintercalate
13921391 IDone _ -> errMsg "left" "succeed"
13931392 IError _ -> errMsg "left" "fail"
13941393 FL.Done c -> return $ Done n c
1395− else return $ Error "sepBy: infinite loop"
1394+ else error "deintercalate: infinite loop"
13961395 Error err -> return $ Error err
13971396
13981397 extract (DeintercalateL fs sL) = do
@@ -1469,7 +1468,7 @@ sepBy
14691468 IPartial sp -> return $ Partial n $ SepByInit fs sp
14701469 IDone _ -> errMsg "content" "succeed"
14711470 IError _ -> errMsg "content" "fail"
1472− else return $ Error "sepBy: infinite loop"
1471+ else error "sepBy: infinite loop"
14731472 Error err -> return $ Error err
14741473
14751474 extract (SepByInit fs sp) = do