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.Tc.Instance.Family

The FamInst type: family instance heads

  • 1 type
  • 9 values
  • Packageghc-9.10.3
  • Exports10
  • LanguageGHC2021
  • LicenceBSD-3-Clause
  • SourceFamily.hs

tcTopNormaliseNewTypeTF_maybe gets rid of top-level newtypes, potentially looking through newtype instances and type synonyms.

It is only used by the type inference engine (specifically, when solving representational equality), and hence it is careful to unwrap only if the relevant data constructor is in scope. That's why it gets a GlobalRdrEnv argument.

It is careful not to unwrap data/newtype instances nor synonyms if it can't continue unwrapping. Such care is necessary for proper error messages.

It does not look through type families. It does not normalise arguments to a tycon.

If the result is Just ((gres, co), rep_ty), then co : ty ~R rep_ty gres are the GREs for the data constructors that had to be in scope

Injectivity

2 declarations
valuereportInjectivityErrors
  1. :: DynFlags
  2. -> CoAxiom br

    Type family for which we generate errors

  3. -> CoAxBranch

    Currently checked equation (represented by axiom)

  4. -> [Bool]

    Injectivity annotation

  5. -> TcM ()
#

Report a list of injectivity errors together with their source locations. Looks only at one equation; does not look for conflicts *among* equations.