syntactic-1.2.1: Generic abstract syntax, and utilities for embedded languages

Safe HaskellNone

Language.Syntactic.Interpretation.Equality

Synopsis

Documentation

class Equality expr whereSource

Equality for expressions

Methods

equal :: expr a -> expr b -> BoolSource

Equality for expressions

Comparing expressions of different types is often needed when dealing with expressions with existentially quantified sub-terms.

exprHash :: expr a -> HashSource

Computes a Hash for an expression. Expressions that are equal according to equal must result in the same hash:

equal a b  ==>  exprHash a == exprHash b

Instances

Equality Semantics 
Equality Empty 
Equality Condition 
Equality Construct 
Equality Identity 
Equality Literal 
Equality Select 
Equality Tuple 
Equality Let 
Equality Lambda

equal does strict identifier comparison; i.e. no alpha equivalence.

exprHash assigns the same hash to all Lambda bindings. This is a valid over-approximation that enables the following property:

alphaEq a b  ==>  exprHash a == exprHash b
Equality Variable

equal does strict identifier comparison; i.e. no alpha equivalence.

exprHash assigns the same hash to all variables. This is a valid over-approximation that enables the following property:

alphaEq a b  ==>  exprHash a == exprHash b
Equality dom => Equality (AST dom) 
Monad m => Equality (MONAD m) 
(Equality expr1, Equality expr2) => Equality (:+: expr1 expr2) 
Equality dom => Equality (:|| dom pred) 
Equality dom => Equality (:| dom pred) 
Equality expr => Equality (Decor info expr) 
Equality dom => Equality (SubConstr1 c dom p) 
Equality dom => Equality (SubConstr2 c dom pa pb)