HORIZON HASKELLDocslts/ghc-10.0.x8fef28d2026-11-02Search packagesCtrl K
Theme: |

GHC 10.0.0.20260917 · lts/ghc-10.0.x · 8fef28d · 2026-11-02

valuenewMethodFromName
  1. :: CtOrigin

    why do we need this?

  2. -> Name

    name of the method

  3. -> [TcRhoType]

    types with which to instantiate the class

  4. -> TcM (HsExpr GhcTc)

Used when Name is the wired-in name for a wired-in class method, so the caller knows its type for sure, which should be of form

forall a. C a => <blah>

newMethodFromName is supposed to instantiate just the outer type variable and constraint

Returns free variables of constraints as a non-deterministic set This must consult only the ctPred, so that it gets *tidied* fvs if the constraint has been tidied. Tidying a constraint does not tidy the fields of the Ct, only the predicate in the CtEvidence.