Stability | experimental |
---|---|
Maintainer | developer@flocc.net |
Safe Haskell | Safe-Inferred |
For more information please see http://www.flocc.net/
- class VarsIn a where
- type VarSubsts a = IntMap a
- applyVarSubst :: VarsIn a => VarSubsts a -> Idx -> a
- fromList :: VarsIn a => [(Idx, a)] -> VarSubsts a
- fromDisjointList :: VarsIn a => [(Idx, a)] -> VarSubsts a
- composeVarSubsts :: VarsIn a => VarSubsts a -> VarSubsts a -> VarSubsts a
- newVars :: (Monad m, VarsIn a) => Set Idx -> a -> StateT IdxSet m a
- emptyVarSubsts :: IntMap a
Documentation
applyVarSubst :: VarsIn a => VarSubsts a -> Idx -> a
applyVarSubst takes a map of substitutions and a var id |and returns the substituted value if there is one, or |Var i if there isn't.
fromList :: VarsIn a => [(Idx, a)] -> VarSubsts a
fromList takes a list of (var id, VarsIn) pairs |and returns a VarSubsts for that list such that |subs are applied from left to right (left first...)
fromDisjointList :: VarsIn a => [(Idx, a)] -> VarSubsts a
fromDisjointList takes a list of disjoint (Var id, VarsIn) pairs |and returns a VarSubsts.
composeVarSubsts :: VarsIn a => VarSubsts a -> VarSubsts a -> VarSubsts a
composeSubsts a b sequentially composes a and b |such that a is applied after b.
newVars :: (Monad m, VarsIn a) => Set Idx -> a -> StateT IdxSet m a
newVars varsToChange a, takes |a list of var ids to change, and an instance of VarsIn and returns |the same VarsIn a with the var ids to change replaced with new ones |from the newids in the state monad.
emptyVarSubsts :: IntMap a
emptyVarSubsts is an empty set of substitutions