Parsec is a library for writing parsers written in the programming language Haskell.
[12] Because a parser combinator-based program is generally slower than a parser generator-based program,[citation needed] Parsec is normally used for small domain-specific languages, while Happy is used for compilers such as the Glasgow Haskell Compiler (GHC).
[13] Other Haskell parser combinator libraries that have been derived from Parsec include Megaparsec[14] and Attoparsec.
[15] Parsec is free software released under the BSD-3-Clause license.
If we wanted to alter this program, say to read either the string "hello" or the string "goodbye", we could use the operator <|>, provided by the Alternative typeclass, to combine two parsers into a single parser that tries either: This free and open-source software article is a stub.