on master help sign in
Add a note about alternative way to parse words
48ad6dbHarendra Kumar
core/src/Streamly/Internal/Data/Parser.hs+5
@@ -758,6 +758,11 @@ escapedFrameBy _begin _end _escape _p = undefined
758-- Grouping and words
758-- Grouping and words
759-------------------------------------------------------------------------------
759-------------------------------------------------------------------------------
760
760
761+-- Note we can also get words using something like:
762+-- sepBy FL.toList (takeWhile (not . p) Fold.toList) (dropWhile p)
763+--
764+-- But that won't be as efficient and ergonomic.
765+--
761-- | Like 'splitOn' but strips leading, trailing, and repeated separators.
766-- | Like 'splitOn' but strips leading, trailing, and repeated separators.
762-- Therefore, @".a..b."@ having '.' as the separator would be parsed as
767-- Therefore, @".a..b."@ having '.' as the separator would be parsed as
763-- @["a","b"]@. In other words, its like parsing words from whitespace
768-- @["a","b"]@. In other words, its like parsing words from whitespace