Module FlatCurry.Match

Some useful operations to support selection of FlatCurry expressions via deep pattern matching.

Summary of exported operations:

withExp :: Expr -> Expr  Non-deterministic 
Returns (non-deterministically) some expression that contains the given expression as a subexpression.
funWithExp :: (String,String) -> Expr -> FuncDecl  Non-deterministic 
Returns (non-deterministically) a function declaration containing the given expression in the right-hand side.
funWithinExp :: (String,String) -> Expr -> Expr -> Expr -> FuncDecl  Non-deterministic 
Returns (non-deterministically) some function declaration for the given function name where the right-hand side is the given expression with a variable hole and a subexression.

Exported operations:

withExp :: Expr -> Expr  Non-deterministic 

Returns (non-deterministically) some expression that contains the given expression as a subexpression.

funWithExp :: (String,String) -> Expr -> FuncDecl  Non-deterministic 

Returns (non-deterministically) a function declaration containing the given expression in the right-hand side.

funWithinExp :: (String,String) -> Expr -> Expr -> Expr -> FuncDecl  Non-deterministic 

Returns (non-deterministically) some function declaration for the given function name where the right-hand side is the given expression with a variable hole and a subexression.

Example call:
(funWithinExp qf e x se)
Parameters:
  • qf : The qualified function name
  • e : The right-hand side with a hole containing x
  • x : The variable in the hole
  • se : The subexpression at the hole in the right-hand side
Returns:
The function declaration with e as the right-hand side