ghc-9.10.3: The GHC API

Safe Haskell | None
Language | GHC2021

GHC.Tc.Deriv

Description

Handles `deriving` clauses on `data` declarations.

Synopsis

- tcDeriving :: [DerivInfo] -> [LDerivDecl GhcRn] -> TcM (TcGblEnv, Bag (InstInfo GhcRn), HsValBinds GhcRn)
- data DerivInfo = DerivInfo {
  - di_rep_tc :: TyCon
  - di_scoped_tvs :: ![(Name, TyVar)]
  - di_clauses :: [LHsDerivingClause GhcRn]
  - di_ctxt :: SDoc
  }

# Documentation

tcDeriving :: [DerivInfo] -> [LDerivDecl GhcRn] -> TcM (TcGblEnv, Bag (InstInfo GhcRn), HsValBinds GhcRn) Source #

data DerivInfo Source #

Stuff needed to process a datatype's `deriving` clauses

Constructors

DerivInfo |

Fields

- di_rep_tc :: TyCon

  The data tycon for normal datatypes, or the *representation* tycon for data families

- di_scoped_tvs :: ![(Name, TyVar)]

  Variables that scope over the deriving clause. See `Note [Scoped tyvars in a TcTyCon]` in GHC.Core.TyCon.

- di_clauses :: [LHsDerivingClause GhcRn]
- di_ctxt :: SDoc

  error context