egison-pattern-src-0.2.1.1: Manipulating Egison patterns: abstract syntax, parser, and pretty-printer

Language.Egison.Syntax.Pattern.Expr

Description

This module defines an AST (Abstract Syntax Tree) for Egison pattern expression.

Synopsis

# Documentation

data Expr n v e Source #

Egison pattern expressions. n is a type for name references in patterns, such as them in pattern constructors. v is a type for name bindings in patterns, such as them in pattern variables. e is a type for expressions in patterns, such as them in value patterns.

Constructors

 Wildcard Wildcard pattern. Match with everything. Variable v Pattern variable. The matched term is bound to the name. Value e Value pattern. Match with equal terms. Predicate e Predicate pattern. Match with terms that satisfy the given predicate. And (Expr n v e) (Expr n v e) And pattern. Match when both patterns matches. Or (Expr n v e) (Expr n v e) Or pattern. Match when one of given patterns matches. Not (Expr n v e) Not pattern. Match when the given pattern does not match. Tuple [Expr n v e] Tuple pattern. Match with tuples whose elements match with respective patterns. Collection [Expr n v e] Collection pattern. Match with collections whose elements match with respective patterns. Infix n (Expr n v e) (Expr n v e) User-defined infix pattern. Pattern n [Expr n v e] User-defined normal pattern.
Instances