Applicative permutation parser for Parsec intended as a replacement for Text.Parsec.Perm.
|Latest on Hackage:||0.1.2.0|
This package is not currently in any snapshots. If you're interested in using it, we recommend adding it to Stackage Nightly. Doing so will make builds more reliable, and allow stackage.org to host generated Haddocks.
a generalized replacement for Text.Parsec.Perm in parsec.
> import Text.Parsec.Permutation
> fooParser :: ParsecT s u m a -> ParsecT s u m [a]
> fooParser = runPermParser $
> (,,) <$> oncePerm (char 'A')
> <*> manyPerm (char 'B')
> <*> optionMaybePerm (char 'C' >> char 'D')
This parser will return ('A', "BBB", Just 'D') when parsing for example
the strings "BCDABB", "CDBBAB", etc.