Portability | non-portable (GHC Extensions) |
---|---|
Stability | experimental |
Maintainer | Patrick Bahr <paba@diku.dk> |
This module defines an abstraction notion of a variable in compositional data type.
- class HasVars f v where
- type Subst f v = CxtSubst NoHole Nothing f v
- type CxtSubst h a f v = Map v (Cxt h f a)
- varsToHoles :: (Functor f, HasVars f v) => Term f -> Context f v
- containsVar :: (Eq v, HasVars f v, Foldable f, Functor f) => v -> Cxt h f a -> Bool
- variables :: (Ord v, HasVars f v, Foldable f, Functor f) => Cxt h f a -> Set v
- variableList :: (Ord v, HasVars f v, Foldable f, Functor f) => Cxt h f a -> [v]
- variables' :: (Ord v, HasVars f v, Foldable f, Functor f) => Const f -> Set v
- substVars :: SubstVars v t a => (v -> Maybe t) -> a -> a
- appSubst :: (Ord v, SubstVars v t a) => Map v t -> a -> a
- compSubst :: (Ord v, HasVars f v, Functor f) => CxtSubst h a f v -> CxtSubst h a f v -> CxtSubst 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, Foldable f, Functor f) => v -> Cxt h f a -> BoolSource
This function checks whether a variable is contained in a context.
variables :: (Ord v, HasVars f v, Foldable f, Functor f) => Cxt h f a -> Set vSource
This function computes the set of variables occurring in a context.
variableList :: (Ord v, HasVars f v, Foldable f, Functor f) => Cxt h f a -> [v]Source
This function computes the list of variables occurring in a context.