Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data CoreMap a
- emptyCoreMap :: CoreMap a
- extendCoreMap :: CoreMap a -> CoreExpr -> a -> CoreMap a
- lookupCoreMap :: CoreMap a -> CoreExpr -> Maybe a
- foldCoreMap :: (a -> b -> b) -> b -> CoreMap a -> b
- data TypeMap a
- emptyTypeMap :: TypeMap a
- extendTypeMap :: TypeMap a -> Type -> a -> TypeMap a
- lookupTypeMap :: TypeMap a -> Type -> Maybe a
- foldTypeMap :: (a -> b -> b) -> b -> TypeMap a -> b
- data LooseTypeMap a
- data CmEnv
- lookupCME :: CmEnv -> Var -> Maybe BoundVar
- extendTypeMapWithScope :: TypeMap a -> CmEnv -> Type -> a -> TypeMap a
- lookupTypeMapWithScope :: TypeMap a -> CmEnv -> Type -> Maybe a
- mkDeBruijnContext :: [Var] -> CmEnv
- data MaybeMap m a
- data ListMap m a
- type LiteralMap a = Map Literal a
- data GenMap m a
- class TrieMap m where
- insertTM :: TrieMap m => Key m -> a -> m a -> m a
- deleteTM :: TrieMap m => Key m -> m a -> m a
- lkDFreeVar :: Var -> DVarEnv a -> Maybe a
- xtDFreeVar :: Var -> XT a -> DVarEnv a -> DVarEnv a
- lkDNamed :: NamedThing n => n -> DNameEnv a -> Maybe a
- xtDNamed :: NamedThing n => n -> XT a -> DNameEnv a -> DNameEnv a
- (>.>) :: (a -> b) -> (b -> c) -> a -> c
- (|>) :: a -> (a -> b) -> b
- (|>>) :: TrieMap m2 => (XT (m2 a) -> m1 (m2 a) -> m1 (m2 a)) -> (m2 a -> m2 a) -> m1 (m2 a) -> m1 (m2 a)
Maps over Core expressions
CoreMap a
is a map from CoreExpr
to a
. If you are a client, this
is the type you want.
emptyCoreMap :: CoreMap a Source #
foldCoreMap :: (a -> b -> b) -> b -> CoreMap a -> b Source #
Maps over Expr
s
TypeMap a
is a map from Expr
to a
. If you are a client, this
is the type you want. The keys in this map may have different kinds.
emptyTypeMap :: TypeMap a Source #
foldTypeMap :: (a -> b -> b) -> b -> TypeMap a -> b Source #
data LooseTypeMap a Source #
A LooseTypeMap
doesn't do a kind-check. Thus, when lookup up (t |> g),
you'll find entries inserted under (t), even if (g) is non-reflexive.
Instances
TrieMap LooseTypeMap Source # | |
Defined in CoreMap type Key LooseTypeMap :: Type Source # emptyTM :: LooseTypeMap a Source # lookupTM :: Key LooseTypeMap -> LooseTypeMap b -> Maybe b Source # alterTM :: Key LooseTypeMap -> XT b -> LooseTypeMap b -> LooseTypeMap b Source # mapTM :: (a -> b) -> LooseTypeMap a -> LooseTypeMap b Source # foldTM :: (a -> b -> b) -> LooseTypeMap a -> b -> b Source # | |
type Key LooseTypeMap Source # | |
Defined in CoreMap |
With explicit scoping
extendTypeMapWithScope :: TypeMap a -> CmEnv -> Type -> a -> TypeMap a Source #
Extend a TypeMap
with a type in the given context.
extendTypeMapWithScope m (mkDeBruijnContext [a,b,c]) t v
is equivalent to
extendTypeMap m (forall a b c. t) v
, but allows reuse of the context over
multiple insertions.
mkDeBruijnContext :: [Var] -> CmEnv Source #
Construct a deBruijn environment with the given variables in scope.
e.g. mkDeBruijnEnv [a,b,c]
constructs a context forall a b c.
Maps over Maybe
values
Maps over List
values
Maps over Literal
s
type LiteralMap a = Map Literal a Source #
Map for compressing leaves. See Note [Compressed TrieMap]
TrieMap
class
class TrieMap m where Source #
lookupTM :: forall b. Key m -> m b -> Maybe b Source #
alterTM :: forall b. Key m -> XT b -> m b -> m b Source #
Instances
TrieMap IntMap Source # | |
Defined in TrieMap | |
TrieMap UniqDFM Source # | |
Defined in TrieMap | |
TrieMap LabelMap Source # | |
Defined in Hoopl.Label | |
TrieMap LooseTypeMap Source # | |
Defined in CoreMap type Key LooseTypeMap :: Type Source # emptyTM :: LooseTypeMap a Source # lookupTM :: Key LooseTypeMap -> LooseTypeMap b -> Maybe b Source # alterTM :: Key LooseTypeMap -> XT b -> LooseTypeMap b -> LooseTypeMap b Source # mapTM :: (a -> b) -> LooseTypeMap a -> LooseTypeMap b Source # foldTM :: (a -> b -> b) -> LooseTypeMap a -> b -> b Source # | |
TrieMap TypeMap Source # | |
Defined in CoreMap | |
TrieMap CoreMap Source # | |
Defined in CoreMap | |
Ord k => TrieMap (Map k) Source # | |
(Eq (Key m), TrieMap m) => TrieMap (GenMap m) Source # | |
Defined in TrieMap | |
TrieMap m => TrieMap (ListMap m) Source # | |
Defined in TrieMap | |
TrieMap m => TrieMap (MaybeMap m) Source # | |
Defined in TrieMap |