haskell - Skipping whitespace excluding newlines in attoparsec -
attoparsec provides function skipspace.
this function consumes whitespace available.
how can implement function skipspacenonewline skips whitespace except \n , \r\n?
note: question intentionally shows no research effort answered q&a-style.
you can combine skipwhile , isendofline (which matches both \n , \r\n).
using lambda function, can combine them skipwhile predicate skips whitespace except newlines.
skipspacenonewline = skipwhile (\x -> isspace_w8 x && not (isendofline x))
Comments
Post a Comment