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

Safe HaskellNone



Useful combinators to manipulate Egison pattern ASTs.



unAnnotate :: Cofree (ExprF n v e) a -> Expr n v e Source #

Unwrap annotations from AST.

foldExpr :: (ExprF n v e a -> a) -> Expr n v e -> a Source #

fold an v expr.

Note that this is just a type specialization of cata.

mapName :: (n -> n') -> Expr n v e -> Expr n' v e Source #

Map over n in Expr n v e.

mapVarName :: (v -> v') -> Expr n v e -> Expr n v' e Source #

Map over v in Expr n v e.

mapValueExpr :: (e -> e') -> Expr n v e -> Expr n v e' Source #

Map over e in Expr n v e.

variables :: Alternative f => Expr n v e -> f v Source #

List bound pattern variables in a pattern.