TcDeriv

ghc-8.6.3: The GHC API

Safe Haskell | None
Language | Haskell2010

TcDeriv

Synopsis

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

# Documentation

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

data DerivInfo #

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_clauses :: [LHsDerivingClause GhcRn] di_ctxt :: SDoc error context

mkDerivInfos :: [LTyClDecl GhcRn] -> TcM [DerivInfo] #

Extract `deriving` clauses of proper data type (skips data families)