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-prim-0.12.0Haskell2010

GHC.Magic.Dict

Defines the withDict function. For more information, see Note [withDict] in GHC.Tc.Instance.Class in GHC. The definition of withDict is located in a separate module from GHC.Magic because withDict is Unsafe (it threatens type class coherence) while GHC.Magic is Trustworthy.

Use GHC.Exts from the base package instead of importing this module directly.

  • 1 class
  • Packageghc-prim-0.12.0
  • Exports1
  • LanguageHaskell2010
  • LicenceBSD-3-Clause
  • SourceDict.hs
classclass WithDict (cls :: Constraint) meth where
#

The constraint WithDict cls meth can be solved when evidence for the constraint cls can be provided in the form of a dictionary of type meth. This requires cls to be a class constraint whose single method has type meth.

For more (important) details on how this works, see Note [withDict] in GHC.Tc.Instance.Class in GHC.

Methods