Skip to content

Instantly share code, notes, and snippets.

@opqdonut
Created May 31, 2016 16:46
Show Gist options
  • Save opqdonut/8e17f2d86ff3533f08b10800e9681944 to your computer and use it in GitHub Desktop.
Save opqdonut/8e17f2d86ff3533f08b10800e9681944 to your computer and use it in GitHub Desktop.
ghci> let manyThen x end = choice [(:) <$> x <*> manyThen x end, const [] <$> end]
ghci> parseOnly (manyThen anyChar (char ':')) (pack "he:llo:")
Right "he:llo"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment