HORIZON HASKELLDocslts/ghc-9.10.xc74966e2026-09-27Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · c74966e · 2026-09-27

Moduleghc-9.10.3GHC2021

GHC.Core.InstEnv

  • 13 types
  • 42 values
  • Packageghc-9.10.3
  • Exports55
  • LanguageGHC2021
  • LicenceBSD-3-Clause
  • SourceVar.hs
typetype DFunId = Id
#

Dictionary Function Identifier

datadata OverlapFlag
#

The semantics allowed for overlapping instances for a particular instance. See Note [Safe Haskell isSafeOverlap] in GHC.Core.InstEnv for a explanation of the isSafeOverlap field.

Instances4Eq, Data, Outputable, Binary
datadata OverlapMode
#

Constructors

  • NoOverlap SourceText

    This instance must not overlap another NoOverlap instance. However, it may be overlapped by Overlapping instances, and it may overlap Overlappable instances.

  • Overlappable SourceText

    Silently ignore this instance if you find a more specific one that matches the constraint you are trying to resolve

    Example: constraint (Foo [Int]) instance Foo [Int] instance {-# OVERLAPPABLE #-} Foo [a]

    Since the second instance has the Overlappable flag, the first instance will be chosen (otherwise its ambiguous which to choose)

  • Overlapping SourceText

    Silently ignore any more general instances that may be used to solve the constraint.

    Example: constraint (Foo [Int]) instance {-# OVERLAPPING #-} Foo [Int] instance Foo [a]

    Since the first instance has the Overlapping flag, the second---more general---instance will be ignored (otherwise it is ambiguous which to choose)

  • Overlaps SourceText

    Equivalent to having both Overlapping and Overlappable flags.

  • Incoherent SourceText

    Behave like Overlappable and Overlapping, and in addition pick an arbitrary one if there are multiple matching candidates, and don't worry about later instantiation

    Example: constraint (Foo [b]) instance {-# INCOHERENT -} Foo [Int] instance Foo [a] Without the Incoherent flag, we'd complain that instantiating b would change which instance was chosen. See also Note [Incoherent instances] in GHC.Core.InstEnv

  • NonCanonical SourceText

    Behave like Incoherent, but the instance choice is observable by the program behaviour. See Note [Coherence and specialisation: overview].

    We don't have surface syntax for the distinction between Incoherent and NonCanonical instances; instead, the flag `-f{no-}specialise-incoherents` (on by default) controls whether INCOHERENT instances are regarded as Incoherent or NonCanonical.

Instances7Eq, Data, Outputable, Binary, ToHie, Anno, …
datadata ClsInst
#

A type-class instance. Note that there is some tricky laziness at work here. See Note [ClsInst laziness and the rough-match fields] for more details.

Constructors

Instances3Data, NamedThing, Outputable

Collects the names of concrete types and type constructors that make up the head of a class instance. For instance, given `class Foo a b`:

`instance Foo (Either (Maybe Int) a) Bool` would yield [Either, Maybe, Int, Bool]

Used in the implementation of ":info" in GHCi.

The tcSplitSigmaTy is because of instance Foo a => Baz T where ... The decl is an orphan if Baz and T are both not locally defined, even if Foo *is* locally defined

Set of visible orphan modules, according to what modules have been directly imported. This is based off of the dep_orphs field, which records transitively reachable orphan modules (modules that define orphan instances).

Why a particular typeclass application couldn't be looked up.

Constructors

Instances2Generic, Rep

True when when the instance heads are the same e.g. both are Eq [(a,b)] Used for overriding in GHCi Obviously should be insensitive to alpha-renaming