Safe Haskell | None |
---|---|
Language | Haskell98 |
A VarMp maps from variables (tvars, ...) to whatever else has to be mapped to (Ty, ...).
Starting with variant 6 (which introduces kinds) it allows multiple meta level mapping, in that the VarMp holds mappings for multiple meta levels. This allows one map to both map to base level info and to higher levels. In particular this is used by fitsIn which also instantiates types, and types may quantify over type variables with other kinds than kind *, which must be propagated. A separate map could have been used, but this holds the info together and is extendible to more levels.
A multiple level VarMp knows its own absolute metalevel, which is the default to use for lookup.
- data VarMp' k v = VarMp {
- varmpMetaLev :: !MetaLev
- varmpMpL :: [Map k v]
- ppVarMpV :: (PP k, PP v) => VarMp' k v -> PP_Doc
- varmpFilter :: Ord k => (k -> v -> Bool) -> VarMp' k v -> VarMp' k v
- varmpDel :: Ord k => [k] -> VarMp' k v -> VarMp' k v
- (|\>) :: Ord k => VarMp' k v -> [k] -> VarMp' k v
- varmpAlter :: Ord k => (Maybe v -> Maybe v) -> k -> VarMp' k v -> VarMp' k v
- varmpUnion :: Ord k => VarMp' k v -> VarMp' k v -> VarMp' k v
- varmpUnions :: Ord k => [VarMp' k v] -> VarMp' k v
- module UHC.Util.VarLookup
- mkVarMp :: Map k v -> VarMp' k v
- emptyVarMp :: VarMp' k v
- varmpIsEmpty :: VarMp' k v -> Bool
- varmpShiftMetaLev :: MetaLev -> VarMp' k v -> VarMp' k v
- varmpIncMetaLev :: VarMp' k v -> VarMp' k v
- varmpDecMetaLev :: VarMp' k v -> VarMp' k v
- varmpSelectMetaLev :: [MetaLev] -> VarMp' k v -> VarMp' k v
- varmpKeys :: Ord k => VarMp' k v -> [k]
- varmpKeysSet :: Ord k => VarMp' k v -> Set k
- varmpMetaLevSingleton :: Ord k => MetaLev -> k -> v -> VarMp' k v
- varmpSingleton :: Ord k => k -> v -> VarMp' k v
- assocMetaLevLToVarMp :: Ord k => AssocL k (MetaLev, v) -> VarMp' k v
- assocLToVarMp :: Ord k => AssocL k v -> VarMp' k v
- varmpToAssocL :: VarMp' k i -> AssocL k i
- varmpPlus :: Ord k => VarMp' k v -> VarMp' k v -> VarMp' k v
- varmpUnionWith :: Ord k => (v -> v -> v) -> VarMp' k v -> VarMp' k v -> VarMp' k v
- varmpLookup :: (VarLookup m, Ord (VarLookupKey m)) => VarLookupKey m -> m -> Maybe (VarLookupVal m)
- ppVarMp :: (PP k, PP v) => ([PP_Doc] -> PP_Doc) -> VarMp' k v -> PP_Doc
- varmpAsMap :: VarMp' k v -> (Map k v, Map k v -> VarMp' k v)
- varmpMapMaybe :: Ord k => (a -> Maybe b) -> VarMp' k a -> VarMp' k b
- varmpMap :: Ord k => (a -> b) -> VarMp' k a -> VarMp' k b
- varmpInsertWith :: Ord k => (v -> v -> v) -> k -> v -> VarMp' k v -> VarMp' k v
- varmpSize :: VarMp' k v -> Int
- varmpToMap :: VarMp' k v -> Map k v
Documentation
VarMp | |
|
(Eq v, Eq k) => Eq (VarMp' k v) Source # | |
(Ord v, Ord k) => Ord (VarMp' k v) Source # | |
Show (VarMp' k v) Source # | |
Generic (VarMp' k v) Source # | |
(PP k, PP v) => PP (VarMp' k v) Source # | |
Ord k => VarLookup (VarMp' k v) Source # | |
(Ord k, Serialize k, Serialize v) => Serialize (VarMp' k v) Source # | |
Ord k => VarLookupCmb (VarMp' k v) (VarMp' k v) Source # | |
type Rep (VarMp' k v) Source # | |
type VarLookupVal (VarMp' k v) Source # | |
type VarLookupKey (VarMp' k v) Source # | |
varmpAlter :: Ord k => (Maybe v -> Maybe v) -> k -> VarMp' k v -> VarMp' k v Source #
Alter irrespective of level
module UHC.Util.VarLookup
emptyVarMp :: VarMp' k v Source #
varmpIsEmpty :: VarMp' k v -> Bool Source #
varmpIncMetaLev :: VarMp' k v -> VarMp' k v Source #
varmpDecMetaLev :: VarMp' k v -> VarMp' k v Source #
varmpMetaLevSingleton :: Ord k => MetaLev -> k -> v -> VarMp' k v Source #
Deprecated: Use varlookupSingletonWithMetaLev
VarMp singleton
varmpSingleton :: Ord k => k -> v -> VarMp' k v Source #
VarMp singleton
varmpToAssocL :: VarMp' k i -> AssocL k i Source #
varmpUnionWith :: Ord k => (v -> v -> v) -> VarMp' k v -> VarMp' k v -> VarMp' k v Source #
combine by taking the lowest level, adapting the lists with maps accordingly
varmpLookup :: (VarLookup m, Ord (VarLookupKey m)) => VarLookupKey m -> m -> Maybe (VarLookupVal m) Source #
varmpAsMap :: VarMp' k v -> (Map k v, Map k v -> VarMp' k v) Source #
Extract first level map, together with a construction function putting a new map into the place of the previous one
varmpToMap :: VarMp' k v -> Map k v Source #