This module defines the concept of expressions and expression transformers.
An expression is a type constructor of kind
* -> * -> *
where the first argument denotes the "role" of the expression, and the second argument is the type of the value computed by the expression.
An expression transformer is a type constructor of kind
(* -> * -> *) -> (* -> * -> *)
i.e. a expression parameterized by an expression.
Documentation
Expression type with no constructors. Can be used to turn an expression transformer to an expression.
Equality for expressions. The difference between Eq
and ExprEq
is that
ExprEq
allows comparison of expressions with different role and value type.
It is assumed that when the types differ, the expressions also differ. The
reason for allowing comparison of different types is that this is convenient
when the types are existentially quantified.
Evaluation of expressions