Skip to content

Instantly share code, notes, and snippets.

@sorki
Created June 27, 2016 12:37
Show Gist options
  • Save sorki/854a8c04d9d16e81c2d4e010fd0cd081 to your computer and use it in GitHub Desktop.
Save sorki/854a8c04d9d16e81c2d4e010fd0cd081 to your computer and use it in GitHub Desktop.
yumParser :: Parser [YumMsg]
yumParser = (many $ yumEntryParser <* endOfLine)
yumEntryParser =
Separator <$> takeWhile (=='=')
-- Separator <$> string "==="
<|> Message <$> takeTill isEndOfLine
@sorki
Copy link
Author

sorki commented Jun 27, 2016

λ: parse yumParser "===\n===\nanother\n"
Done "another\n" [Separator "===",Separator "==="]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment