Skip to content

Commit

Permalink
Update the readme to reflect the newest Megaparsec 7 changes
Browse files Browse the repository at this point in the history
[skip ci]
  • Loading branch information
mrkkrp committed Jul 15, 2018
1 parent 4ea6a01 commit 163c78e
Showing 1 changed file with 5 additions and 20 deletions.
25 changes: 5 additions & 20 deletions README.md
Expand Up @@ -11,8 +11,6 @@
* [Error messages](#error-messages)
* [Alex support](#alex-support)
* [Character and binary parsing](#character-and-binary-parsing)
* [Permutation parsing](#permutation-parsing)
* [Expression parsing](#expression-parsing)
* [Lexer](#lexer)
* [Documentation](#documentation)
* [Tutorials](#tutorials)
Expand Down Expand Up @@ -101,6 +99,11 @@ need to use a shapeless bunch of strings.
The design of parse errors has been revised in version 6 significantly, but
custom errors are still easy (probably even easier now).

Megaparsec 7 introduced the `ParseErrorBundle` data type that helps to
manage multi-error messages and pretty-print them easily and efficiently.
That version of the library also made the practice of displaying offending
line the default.

### Alex support

Megaparsec works well with streams of tokens produced by tools like Alex.
Expand All @@ -117,24 +120,6 @@ module. Similarly, there is
[`Text.Megaparsec.Byte`](https://hackage.haskell.org/package/megaparsec/docs/Text-Megaparsec-Byte.html)
module for parsing streams of bytes.

### Permutation parsing

For those who are interested in parsing of permutation phrases, there is
[`Text.Megaparsec.Perm`](https://hackage.haskell.org/package/megaparsec/docs/Text-Megaparsec-Perm.html).
You have to import the module explicitly, it's not included in the
`Text.Megaparsec` module.

### Expression parsing

Megaparsec has a solution for parsing of expressions. Take a look at
[`Text.Megaparsec.Expr`](https://hackage.haskell.org/package/megaparsec/docs/Text-Megaparsec-Expr.html).
You have to import the module explicitly, it's not included in the
`Text.Megaparsec`.

Given a table of operators that describes their fixity and precedence, you
can construct a parser that will parse any expression involving the
operators. See documentation for comprehensive description of how it works.

### Lexer

[`Text.Megaparsec.Char.Lexer`](https://hackage.haskell.org/package/megaparsec/docs/Text-Megaparsec-Char-Lexer.html)
Expand Down

0 comments on commit 163c78e

Please sign in to comment.