uhc-util-0.1.6.7: UHC utilities

Safe HaskellNone
LanguageHaskell98

UHC.Util.VarMp

Description

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.

Synopsis

Documentation

data VarMp' k v Source #

Constructors

VarMp 

Fields

Instances

(Eq v, Eq k) => Eq (VarMp' k v) Source # 

Methods

(==) :: VarMp' k v -> VarMp' k v -> Bool #

(/=) :: VarMp' k v -> VarMp' k v -> Bool #

(Ord v, Ord k) => Ord (VarMp' k v) Source # 

Methods

compare :: VarMp' k v -> VarMp' k v -> Ordering #

(<) :: VarMp' k v -> VarMp' k v -> Bool #

(<=) :: VarMp' k v -> VarMp' k v -> Bool #

(>) :: VarMp' k v -> VarMp' k v -> Bool #

(>=) :: VarMp' k v -> VarMp' k v -> Bool #

max :: VarMp' k v -> VarMp' k v -> VarMp' k v #

min :: VarMp' k v -> VarMp' k v -> VarMp' k v #

Show (VarMp' k v) Source # 

Methods

showsPrec :: Int -> VarMp' k v -> ShowS #

show :: VarMp' k v -> String #

showList :: [VarMp' k v] -> ShowS #

Generic (VarMp' k v) Source # 

Associated Types

type Rep (VarMp' k v) :: * -> * #

Methods

from :: VarMp' k v -> Rep (VarMp' k v) x #

to :: Rep (VarMp' k v) x -> VarMp' k v #

(PP k, PP v) => PP (VarMp' k v) Source # 

Methods

pp :: VarMp' k v -> PP_Doc Source #

ppList :: [VarMp' k v] -> PP_Doc 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 # 

Methods

(|+>) :: VarMp' k v -> VarMp' k v -> VarMp' k v Source #

type Rep (VarMp' k v) Source # 
type Rep (VarMp' k v) = D1 (MetaData "VarMp'" "UHC.Util.VarMp" "uhc-util-0.1.6.7-6t9ue1OogRx64o0dPcpUzP" False) (C1 (MetaCons "VarMp" PrefixI True) ((:*:) (S1 (MetaSel (Just Symbol "varmpMetaLev") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 MetaLev)) (S1 (MetaSel (Just Symbol "varmpMpL") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [Map k v]))))
type VarLookupVal (VarMp' k v) Source # 
type VarLookupVal (VarMp' k v) = v
type VarLookupKey (VarMp' k v) Source # 
type VarLookupKey (VarMp' k v) = k

ppVarMpV :: (PP k, PP v) => VarMp' k v -> PP_Doc Source #

varmpFilter :: Ord k => (k -> v -> Bool) -> VarMp' k v -> VarMp' k v Source #

varmpDel :: Ord k => [k] -> VarMp' k v -> VarMp' k v Source #

Delete

(|\>) :: Ord k => VarMp' k v -> [k] -> VarMp' k v Source #

varmpAlter :: Ord k => (Maybe v -> Maybe v) -> k -> VarMp' k v -> VarMp' k v Source #

Alter irrespective of level

varmpUnion :: Ord k => VarMp' k v -> VarMp' k v -> VarMp' k v Source #

varmpUnions :: Ord k => [VarMp' k v] -> VarMp' k v Source #

mkVarMp :: Map k v -> VarMp' k v Source #

varmpKeys :: Ord k => VarMp' k v -> [k] Source #

varmpKeysSet :: Ord k => VarMp' k v -> Set k 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

assocLToVarMp :: Ord k => AssocL k v -> VarMp' k v Source #

varmpPlus :: Ord k => VarMp' k v -> VarMp' k v -> VarMp' k v infixr 7 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

ppVarMp :: (PP k, PP v) => ([PP_Doc] -> PP_Doc) -> VarMp' k v -> PP_Doc 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

varmpMapMaybe :: Ord k => (a -> Maybe b) -> VarMp' k a -> VarMp' k b Source #

varmpMap :: Ord k => (a -> b) -> VarMp' k a -> VarMp' k b Source #

varmpInsertWith :: Ord k => (v -> v -> v) -> k -> v -> VarMp' k v -> VarMp' k v Source #

varmpToMap :: VarMp' k v -> Map k v Source #