Stability | experimental |
---|---|
Safe Haskell | None |
Language | Haskell2010 |
Useful combinators to manipulate Egison pattern ASTs.
Synopsis
- unAnnotate :: Cofree (ExprF n v e) a -> Expr n v e
- foldExpr :: (ExprF n v e a -> a) -> Expr n v e -> a
- mapName :: (n -> n') -> Expr n v e -> Expr n' v e
- mapVarName :: (v -> v') -> Expr n v e -> Expr n v' e
- mapValueExpr :: (e -> e') -> Expr n v e -> Expr n v e'
- variables :: Alternative f => Expr n v e -> f v
Documentation
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
.
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.