chr-data-0.1.0.0: Datatypes required for chr library

Safe HaskellNone
LanguageHaskell2010

CHR.Data.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 #

ppList :: [VarMp' k v] -> PP_Doc #

Ord k => VarLookup (VarMp' k v) Source # 
Ord k => LookupApply (VarMp' k v) (VarMp' k v) Source # 

Methods

apply :: VarMp' k v -> VarMp' k v -> VarMp' k v Source #

type Rep (VarMp' k v) Source # 
type Rep (VarMp' k v) = D1 * (MetaData "VarMp'" "CHR.Data.VarMp" "chr-data-0.1.0.0-7sGx1gkV5D5HYkg5X58x8Q" 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

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

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 #