Safe Haskell | None |
---|---|
Language | Haskell2010 |
Abstractions for looking up (type) variables in structures
Synopsis
- type family VarLookupKey m :: *
- type family VarLookupVal m :: *
- class VarLookup m where
- class LookupApply l1 l2 where
- type MetaLev = Int
- metaLevVal :: MetaLev
- type StackedVarLookup s = Stacks s
Documentation
type family VarLookupKey m :: * Source #
Type family for key of a VarLookup
Instances
type VarLookupKey (StackedVarLookup s) Source # | |
Defined in CHR.Data.VarLookup | |
type VarLookupKey (VarMp' k v) Source # | |
Defined in CHR.Data.VarMp |
type family VarLookupVal m :: * Source #
Type family for value of a VarLookup
Instances
type VarLookupVal (StackedVarLookup s) Source # | |
Defined in CHR.Data.VarLookup | |
type VarLookupVal (VarMp' k v) Source # | |
Defined in CHR.Data.VarMp |
class VarLookup m where Source #
VarLookup abstracts from a Map. The purpose is to be able to combine maps only for the purpose of searching without actually merging the maps. This then avoids the later need to unmerge such mergings. The class interface serves to hide this.
varlookupWithMetaLev :: MetaLev -> VarLookupKey m -> m -> Maybe (VarLookupVal m) Source #
Lookup a key at a level
varlookup :: VarLookupKey m -> m -> Maybe (VarLookupVal m) Source #
Lookup a key
varlookupKeysSetWithMetaLev :: Ord (VarLookupKey m) => MetaLev -> m -> Set (VarLookupKey m) Source #
Keys at a level
varlookupKeysSet :: Ord (VarLookupKey m) => m -> Set (VarLookupKey m) Source #
Keys as Set
varlookupEmpty :: m Source #
Make an empty VarLookup
varlookupSingletonWithMetaLev :: MetaLev -> VarLookupKey m -> VarLookupVal m -> m Source #
Make a singleton VarLookup at a level
varlookupSingleton :: VarLookupKey m -> VarLookupVal m -> m Source #
Make a singleton VarLookup
Instances
Ord k => VarLookup (VarMp' k v) Source # | |
Defined in CHR.Data.VarMp varlookupWithMetaLev :: MetaLev -> VarLookupKey (VarMp' k v) -> VarMp' k v -> Maybe (VarLookupVal (VarMp' k v)) Source # varlookup :: VarLookupKey (VarMp' k v) -> VarMp' k v -> Maybe (VarLookupVal (VarMp' k v)) Source # varlookupKeysSetWithMetaLev :: MetaLev -> VarMp' k v -> Set (VarLookupKey (VarMp' k v)) Source # varlookupKeysSet :: VarMp' k v -> Set (VarLookupKey (VarMp' k v)) Source # varlookupEmpty :: VarMp' k v Source # varlookupSingletonWithMetaLev :: MetaLev -> VarLookupKey (VarMp' k v) -> VarLookupVal (VarMp' k v) -> VarMp' k v Source # varlookupSingleton :: VarLookupKey (VarMp' k v) -> VarLookupVal (VarMp' k v) -> VarMp' k v Source # |
class LookupApply l1 l2 where Source #
Instances
LookupApply l1 l2 => LookupApply l1 (Stacks l2) Source # | |
Ord k => LookupApply (VarMp' k v) (VarMp' k v) Source # | |
metaLevVal :: MetaLev Source #
Base level (of values, usually)
type StackedVarLookup s = Stacks s Source #
VarLookupCmb abstracts the combining
of/from a substitution.
The interface goes along with VarLookup but is split off to avoid functional dependency restrictions.
The purpose is to be able to combine maps only for the purpose of searching without actually merging the maps.
This then avoids the later need to unmerge such mergings.
Stacked VarLookup derived from a base one, to allow a use of multiple lookups but update on top only