Portability | non-portable (GHC Extensions) |
---|---|
Stability | experimental |
Maintainer | Patrick Bahr <paba@diku.dk> |
This module defines an abstraction notion of a variable in a term. All definitions are generalised versions of those in Data.Comp.Variables.
- type GSubst v a = NatM Maybe (K v) a
- type HCxtSubst h a f v = GSubst v (HCxt h f a)
- type Subst f v = HCxtSubst HNoHole HNothing f v
- class HasVars f v where
- varsToHHoles :: forall f v. (HFunctor f, HasVars f v) => HTerm f :-> HContext f (K v)
- containsVarAlg :: (Eq v, HasVars f v, HFoldable f) => v -> HAlg f (K Bool)
- containsVar :: (Eq v, HasVars f v, HFoldable f, HFunctor f) => v -> HCxt h f a :=> Bool
- variableListAlg :: (HasVars f v, HFoldable f) => HAlg f (K [v])
- variableList :: (HasVars f v, HFoldable f, HFunctor f) => HCxt h f a :=> [v]
- variablesAlg :: (Ord v, HasVars f v, HFoldable f) => HAlg f (K (Set v))
- variables :: (Ord v, HasVars f v, HFoldable f, HFunctor f) => HCxt h f a :=> Set v
- variables' :: (Ord v, HasVars f v, HFoldable f, HFunctor f) => HConst f :=> Set v
- substAlg :: HasVars f v => HCxtSubst h a f v -> HAlg f (HCxt h f a)
- class SubstVars v t a where
- appSubst :: SubstVars v t a => GSubst v t -> a :-> a
- compSubst :: (Ord v, HasVars f v, HFunctor f) => HCxtSubst h a f v -> HCxtSubst h a f v -> HCxtSubst h a f v
Documentation
This multiparameter class defines functors with variables. An
instance HasVar f v
denotes that values over f
might contain
variables of type v
.
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.
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.