HORIZON HASKELLDocslts/ghc-10.0.x8174fa42026-10-11Search names, modules, packages, or :: a typeCtrl K

GHC 10.0.0.20260917 · lts/ghc-10.0.x · 8174fa4 · 2026-10-11

Moduleghc-lib-parser-9.14.1.20251220GHC2021

GHC.Core.Map.Type

  • 9 types
  • 1 class
  • 22 values

Re-export generic interface

2 declarations
classclass Functor m => TrieMap (m :: Type -> Type) where
#

Associated types

Methods

Instances18TrieMap, …
  • TrieMap IntMapDefined in ghc-lib-parser-9.14.1.20251220 · GHC.Data.TrieMap
  • TrieMap LabelMapDefined in ghc-lib-parser-9.14.1.20251220 · GHC.Cmm.Dataflow.Label
  • TrieMap AltMapDefined in ghc-lib-parser-9.14.1.20251220 · GHC.Core.Map.Expr
  • TrieMap CoreMapDefined in ghc-lib-parser-9.14.1.20251220 · GHC.Core.Map.Expr
  • TrieMap CoreMapXDefined in ghc-lib-parser-9.14.1.20251220 · GHC.Core.Map.Expr
  • TrieMap BndrMapDefined in ghc-lib-parser-9.14.1.20251220 · GHC.Core.Map.Type
  • TrieMap CoercionMapDefined in ghc-lib-parser-9.14.1.20251220 · GHC.Core.Map.Type
  • TrieMap CoercionMapXDefined in ghc-lib-parser-9.14.1.20251220 · GHC.Core.Map.Type
  • TrieMap LooseTypeMapDefined in ghc-lib-parser-9.14.1.20251220 · GHC.Core.Map.Type
  • TrieMap TyLitMapDefined in ghc-lib-parser-9.14.1.20251220 · GHC.Core.Map.Type
  • TrieMap TypeMapDefined in ghc-lib-parser-9.14.1.20251220 · GHC.Core.Map.Type
  • TrieMap TypeMapXDefined in ghc-lib-parser-9.14.1.20251220 · GHC.Core.Map.Type
  • TrieMap VarMapDefined in ghc-lib-parser-9.14.1.20251220 · GHC.Core.Map.Type
  • Ord k => TrieMap (Map k)Defined in ghc-lib-parser-9.14.1.20251220 · GHC.Data.TrieMap
  • TrieMap m => TrieMap (ListMap m)Defined in ghc-lib-parser-9.14.1.20251220 · GHC.Data.TrieMap
  • TrieMap m => TrieMap (MaybeMap m)Defined in ghc-lib-parser-9.14.1.20251220 · GHC.Data.TrieMap
  • (Eq (Key m), TrieMap m) => TrieMap (GenMap m)Defined in ghc-lib-parser-9.14.1.20251220 · GHC.Data.TrieMap
  • Uniquable key => TrieMap (UniqDFM key)Defined in ghc-lib-parser-9.14.1.20251220 · GHC.Data.TrieMap

Maps over Types

6 declarations
newtypenewtype TypeMap a
#

TypeMap a is a map from Type to a. If you are a client, this is the type you want. The keys in this map may have different kinds.

Instances3Functor, TrieMap, Key
  • Functor TypeMapDefined in ghc-lib-parser-9.14.1.20251220 · GHC.Core.Map.Type
  • TrieMap TypeMapDefined in ghc-lib-parser-9.14.1.20251220 · GHC.Core.Map.Type
  • type Key TypeMap = TypeDefined in ghc-lib-parser-9.14.1.20251220 · GHC.Core.Map.Type
newtypenewtype LooseTypeMap a
#

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.

Instances3Functor, TrieMap, Key

With explicit scoping

valueextendTypeMapWithScope :: TypeMap a -> CmEnv -> Type -> a -> TypeMap a
#

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.

valuemkDeBruijnContext :: [Var] -> CmEnv
#

Construct a deBruijn environment with the given variables in scope. e.g. mkDeBruijnEnv [a,b,c] constructs a context forall a b c.

Utilities for use by friends only

16 declarations
typetype TypeMapG = GenMap TypeMapX
#

TypeMapG a is a map from DeBruijn Type to a. The extended key makes it suitable for recursive traversal, since it can track binders, but it is strictly internal to this module. If you are including a TypeMap inside another TrieMap, this is the type you want. Note that this lookup does not do a kind-check. Thus, all keys in this map must have the same kind. Also note that this map respects the distinction between Type and Constraint, despite the fact that they are equivalent type synonyms in Core.

datadata DeBruijn a
#

DeBruijn a represents a modulo alpha-renaming. This is achieved by equipping the value with a CmEnv, which tracks an on-the-fly deBruijn numbering. This allows us to define an Eq instance for DeBruijn a, even if this was not (easily) possible for a. Note: we purposely don't export the constructor. Make a helper function if you find yourself needing it.

Constructors

Instances7Eq, …
  • Eq (DeBruijn CoreAlt)Defined in ghc-lib-parser-9.14.1.20251220 · GHC.Core.Map.Expr · orphan
  • Eq (DeBruijn CoreExpr)Defined in ghc-lib-parser-9.14.1.20251220 · GHC.Core.Map.Expr · orphan
  • Eq (DeBruijn Coercion)Defined in ghc-lib-parser-9.14.1.20251220 · GHC.Core.Map.Type
  • Eq (DeBruijn Type)Defined in ghc-lib-parser-9.14.1.20251220 · GHC.Core.Map.Type
  • Eq (DeBruijn Var)Defined in ghc-lib-parser-9.14.1.20251220 · GHC.Core.Map.Type
  • Eq (DeBruijn a) => Eq (DeBruijn (Maybe a))Defined in ghc-lib-parser-9.14.1.20251220 · GHC.Core.Map.Type
  • Eq (DeBruijn a) => Eq (DeBruijn [a])Defined in ghc-lib-parser-9.14.1.20251220 · GHC.Core.Map.Type
valuedeBruijnize :: a -> DeBruijn a
#

Synthesizes a DeBruijn a from an a, by assuming that there are no bound binders (an empty CmEnv). This is usually what you want if there isn't already a CmEnv in scope.

datadata BndrMap a
#

A BndrMap is a TypeMapG which allows us to distinguish between binding forms whose binders have different types. For example, if we are doing a TrieMap lookup on (x :: Int) -> (), we should not pick up an entry in the TrieMap for (x :: Bool) -> (): we can disambiguate this by matching on the type (or kind, if this a binder in a type) of the binder.

We also need to do the same for multiplicity! Which, since multiplicities are encoded simply as a Type, amounts to have a Trie for a pair of types. Tries of pairs are composition.

Instances3Functor, TrieMap, Key
  • Functor BndrMapDefined in ghc-lib-parser-9.14.1.20251220 · GHC.Core.Map.Type
  • TrieMap BndrMapDefined in ghc-lib-parser-9.14.1.20251220 · GHC.Core.Map.Type
  • type Key BndrMap = VarDefined in ghc-lib-parser-9.14.1.20251220 · GHC.Core.Map.Type
datadata VarMap a
#
Instances3Functor, TrieMap, Key
  • Functor VarMapDefined in ghc-lib-parser-9.14.1.20251220 · GHC.Core.Map.Type
  • TrieMap VarMapDefined in ghc-lib-parser-9.14.1.20251220 · GHC.Core.Map.Type
  • type Key VarMap = VarDefined in ghc-lib-parser-9.14.1.20251220 · GHC.Core.Map.Type