Parsing and pretty-printing
The libraries in this subsection are as follows:
parsec
: Very featureful, general parser combinator library. Old and poorly maintained. Slower thanattoparsec
attoparsec
: Simple and fast parser combinator library. Fewer features thanParsec
megaparsec
: A fork ofParsec
, well maintained. Extremely flexible. Faster thanParsec
but considerably slower thanAttoparsec
happy
/alex
: Parser combinator libraries aimed towards parsing (programming language) grammars.pcre-heavy
: A reasonable regular-expression library.
Parsing is something that Haskell shines at. Applicative and monadic parser interfaces are really expressive. There are many awesome general-purpose parser libraries for Haskell. In general, the choice should be between Attoparsec
and Megaparsec
.
Attoparsec
should be preferred as speed is critical; Megaparsec
if features are more important. Attoparsec
suits best for well-defined file formats, such as serialization. Megaparsec
is a better choice when dealing with...