compdata-0.1: Compositional Data Types

Portabilitynon-portable (GHC Extensions)
Stabilityexperimental
MaintainerPatrick Bahr <paba@diku.dk>

Data.Comp.Multi.Variables

Description

This module defines an abstraction notion of a variable in a term. All definitions are generalised versions of those in Data.Comp.Variables.

Synopsis

Documentation

type GSubst v a = NatM Maybe (K v) aSource

type HCxtSubst h a f v = GSubst v (HCxt h f a)Source

class HasVars f v whereSource

This multiparameter class defines functors with variables. An instance HasVar f v denotes that values over f might contain variables of type v.

Methods

isVar :: f a :=> Maybe vSource

Instances

HasVars f v => HasVars (HCxt h f) v 
(HasVars f v, HasVars g v) => HasVars (:++: f g) v 

varsToHHoles :: forall f v. (HFunctor f, HasVars f v) => HTerm f :-> HContext f (K v)Source

containsVarAlg :: (Eq v, HasVars f v, HFoldable f) => v -> HAlg f (K Bool)Source

containsVar :: (Eq v, HasVars f v, HFoldable f, HFunctor f) => v -> HCxt h f a :=> BoolSource

This function checks whether a variable is contained in a context.

variableList :: (HasVars f v, HFoldable f, HFunctor f) => HCxt h f a :=> [v]Source

This function computes the list of variables occurring in a context.

variablesAlg :: (Ord v, HasVars f v, HFoldable f) => HAlg f (K (Set v))Source

variables :: (Ord v, HasVars f v, HFoldable f, HFunctor f) => HCxt h f a :=> Set vSource

This function computes the set of variables occurring in a context.

variables' :: (Ord v, HasVars f v, HFoldable f, HFunctor f) => HConst f :=> Set vSource

This function computes the set of variables occurring in a context.

substAlg :: HasVars f v => HCxtSubst h a f v -> HAlg f (HCxt h f a)Source

class SubstVars v t a whereSource

This function substitutes variables in a context according to a partial mapping from variables to contexts.

Methods

substVars :: GSubst v t -> a :-> aSource

Instances

(SubstVars v t a, HFunctor f) => SubstVars v t (f a) 
(Ord v, HasVars f v, HFunctor f) => SubstVars v (HCxt h f a) (HCxt h f a) 

appSubst :: SubstVars v t a => GSubst v t -> a :-> aSource

compSubst :: (Ord v, HasVars f v, HFunctor f) => HCxtSubst h a f v -> HCxtSubst h a f v -> HCxtSubst h a f vSource

This function composes two substitutions s1 and s2. That is, applying the resulting substitution is equivalent to first applying s2 and then s1.