The status of overlapping instances (including no overlap) for a type.
Constructors
NoOverlap (XOverlapMode pass)This instance must not overlap another NoOverlap instance. However, it may be overlapped by Overlapping instances, and it may overlap Overlappable instances.
Overlappable (XOverlapMode pass)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 (XOverlapMode pass)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 (XOverlapMode pass)Equivalent to having both Overlapping and Overlappable flags.
Incoherent (XOverlapMode pass)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
bwould change which instance was chosen. See also Note [Incoherent instances] in GHC.Core.InstEnvNonCanonical (XOverlapMode pass)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
INCOHERENTinstances are regarded as Incoherent or NonCanonical.XOverlapMode !(XXOverlapMode pass)The Trees That Grow extension point constructor.
Instances10Eq, Data, NFData, Outputable, Binary, ToHie, …
(Eq (XOverlapMode pass), Eq (XXOverlapMode pass)) => Eq (OverlapMode pass)Defined in ghc-10.0.0.20260917 · Language.Haskell.Syntax.Decls.OverlapData (OverlapMode GhcPs)Defined in ghc-10.0.0.20260917 · GHC.Hs.Instances · orphanData (OverlapMode GhcRn)Defined in ghc-10.0.0.20260917 · GHC.Hs.Instances · orphanData (OverlapMode GhcTc)Defined in ghc-10.0.0.20260917 · GHC.Hs.Instances · orphanNFData (OverlapMode (GhcPass p))Defined in ghc-10.0.0.20260917 · GHC.Hs.Decls.Overlap · orphan(NFData (XOverlapMode pass), NFData (XXOverlapMode pass)) => NFData (OverlapMode pass)Defined in ghc-10.0.0.20260917 · Language.Haskell.Syntax.Decls.OverlapOutputable (OverlapMode p)Defined in ghc-10.0.0.20260917 · GHC.Utils.OutputableBinary (OverlapMode (GhcPass p))Defined in ghc-10.0.0.20260917 · GHC.Hs.Decls.Overlap · orphanToHie (LocatedP (OverlapMode GhcRn))Defined in ghc-10.0.0.20260917 · GHC.Iface.Ext.Asttype Anno (OverlapMode (GhcPass p)) = SrcSpanAnnPDefined in ghc-10.0.0.20260917 · GHC.Hs.Decls · orphan