I have the following definition in a parser using the Haskell ReadP
library:
expr = chainl1 comp (string "===" >> return fun6)
How can I skip spaces before the ===
operator? I don't know how to include it in this syntax.
I have the following definition in a parser using the Haskell ReadP
library:
expr = chainl1 comp (string "===" >> return fun6)
How can I skip spaces before the ===
operator? I don't know how to include it in this syntax.
ReadP
has skipSpaces
for exactly that usecase; your parser then becomes
expr = chainl1 comp (skipSpaces >> string "===" >> return fun6)