on master help sign in
Add a note about alternative way to parse words
commit48ad6db8aff6a3fedc3c02256e6b1ad58331321c authorHarendra Kumar <harendra@composewell.com> dateThu 5 May 2022, 00:25 (4 years ago) parent183a887
1 file changed+5
core/src/Streamly/Internal/Data/Parser.hs+5
core/src/Streamly/Internal/Data/Parser.hs+5
@@ -758,6 +758,11 @@ escapedFrameBy _begin _end _escape _p = undefined
758758-- Grouping and words
759759-------------------------------------------------------------------------------
760760
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+--
761766-- | Like 'splitOn' but strips leading, trailing, and repeated separators.
762767-- Therefore, @".a..b."@ having '.' as the separator would be parsed as
763768-- @["a","b"]@. In other words, its like parsing words from whitespace