3 ms·
Parsec is good but it's a rather old library. For more specialised needs there are even better choices in Haskell: (taken from Gabriel Gonzalez's recent post)
by kccqzy 11y ago
Parsec is good but it's a rather old library. For more specialised needs there are even better choices in Haskell: (taken from Gabriel Gonzalez's recent post)
* attoparsec remains the king of speed, generating parsers competitive in speed with C
* trifecta remains the king of error messages, generating gorgeous clang-style errors
* earley is a newcomer but deals with context-free grammars, while other parser combinatory are basically recursive descent parsers
* and good old alex+happy for direct yacc+bison equivalent
* I should probably mention that in certain simple cases you don't even need a parser combinator library to parse things. Just a good old `StateT (Text, r) [] ()` or similar can do wonders.