uhc-util-0.1.6.7: UHC utilities

Safe HaskellNone
LanguageHaskell98

UHC.Util.Substitutable

Synopsis

Documentation

class VarUpdatable vv subst where Source #

Term in which variables can be updated with a subst(itution)

Minimal complete definition

varUpd

Methods

varUpd :: subst -> vv -> vv infixr 6 Source #

Update

varUpdCyc :: subst -> vv -> (vv, VarMp' (VarLookupKey subst) (VarLookupVal subst)) infixr 6 Source #

Update with cycle detection

Instances

(Ord (VarLookupKey subst), VarUpdatable vv subst) => VarUpdatable [vv] subst Source # 

Methods

varUpd :: subst -> [vv] -> [vv] Source #

varUpdCyc :: subst -> [vv] -> ([vv], VarMp' (VarLookupKey subst) (VarLookupVal subst)) Source #

VarUpdatable vv subst => VarUpdatable (Maybe vv) subst Source # 

Methods

varUpd :: subst -> Maybe vv -> Maybe vv Source #

varUpdCyc :: subst -> Maybe vv -> (Maybe vv, VarMp' (VarLookupKey subst) (VarLookupVal subst)) Source #

(VarUpdatable c s, VarUpdatable p s) => VarUpdatable (RuleBodyAlt c p) s Source # 
(VarUpdatable c s, VarUpdatable g s, VarUpdatable bp s, VarUpdatable p s) => VarUpdatable (Rule c g bp p) s Source # 

Methods

varUpd :: s -> Rule c g bp p -> Rule c g bp p Source #

varUpdCyc :: s -> Rule c g bp p -> (Rule c g bp p, VarMp' (VarLookupKey s) (VarLookupVal s)) Source #

class Ord (ExtrValVarKey vv) => VarExtractable vv where Source #

Term from which free variables can be extracted

Methods

varFree :: vv -> [ExtrValVarKey vv] Source #

Free vars, as a list

varFreeSet :: vv -> Set (ExtrValVarKey vv) Source #

Free vars, as a set

type family ExtrValVarKey vv :: * Source #

The variable wich is used as a key into a substitution

Instances

class VarTerm vv where Source #

Term with a (substitutable, extractable, free, etc.) variable

Minimal complete definition

varTermMbKey, varTermMkKey

Methods

varTermMbKey :: vv -> Maybe (ExtrValVarKey vv) Source #

Maybe is a key

varTermMkKey :: ExtrValVarKey vv -> vv Source #

Construct wrapper for key (i.e. lift, embed)