@hackage egison-pattern-src0.2.2.0
Manipulating Egison patterns: abstract syntax, parser, and pretty-printer
Categories
License
BSD-3-Clause
Maintainer
coord_e <me@coord-e.com>, Satoshi Egi <egi@egison.org>
Links
Versions
Installation
Tested Compilers
Dependencies (9)
- base >=4.8 && <5
- containers >=0.5.4 && <0.7
- free >=5.0.1 && <5.3
- megaparsec >=7.0.0 && <10.0
- mtl >=2.2.1 && <2.4
- parser-combinators >=1.0.0 && <1.3 Show all…
Dependents (4)
@hackage/mini-egison, @hackage/sweet-egison, @hackage/egison-pattern-src-th-mode, @hackage/egison-pattern-src-haskell-mode
Egison Pattern Source
The egison-pattern-src provides a standalone syntax definition for patterns in the Egison programming language. This package enables you to embed Egison's patterns in your parser (pretty-printer) by supplying expression and name parsers (printers) externally.
Syntax
The following is a simplified syntax of pattern expressions where v, c, op and e are meta-variables for variable names, constructor names, user-defined infix operators, and expressions in host language, respectively.
p ::= _ (wildcard pattern)
| $v (pattern variable)
| #e (value pattern)
| ?e (predicate pattern)
| (p_1, p_2, ..., p_n) (tuple pattern)
| [p_1, p_2, ..., p_n] (collection pattern)
| p & p (and-pattern)
| p | p (or-pattern)
| !p (not-pattern)
| p op p (user-defined infix pattern)
| c p_1 p_2 ... p_n (constructor pattern)
License
egison-pattern-src is distributed as open source software under the terms of the 3 clause BSD License. See LICENSE for details.