I have an Attoparsec parser like this:
myParser :: Parser Text
myParser = char '"' *> takeWhile (not . isspace) <* char '"'
I want to make this parser optional so I get a function that returns Just txt
if the parser matches and Nothing
else, i.e. a function of the signature:
myMaybeParser :: Parser (Maybe Text)
How can I do this?