TcGenDeriv

ghc-8.4.4: The GHC API

Safe Haskell | None
Language | Haskell2010

TcGenDeriv

Synopsis

- type BagDerivStuff = Bag DerivStuff
- data DerivStuff
  - = DerivAuxBind AuxBindSpec
  - | DerivFamInst FamInst
  - | DerivHsBind (LHsBind GhcPs, LSig GhcPs)
- gen_Eq_binds :: SrcSpan -> TyCon -> TcM (LHsBinds GhcPs, BagDerivStuff)
- gen_Ord_binds :: SrcSpan -> TyCon -> TcM (LHsBinds GhcPs, BagDerivStuff)
- gen_Enum_binds :: SrcSpan -> TyCon -> TcM (LHsBinds GhcPs, BagDerivStuff)
- gen_Bounded_binds :: SrcSpan -> TyCon -> (LHsBinds GhcPs, BagDerivStuff)
- gen_Ix_binds :: SrcSpan -> TyCon -> TcM (LHsBinds GhcPs, BagDerivStuff)
- gen_Show_binds :: (Name -> Fixity) -> SrcSpan -> TyCon -> (LHsBinds GhcPs, BagDerivStuff)
- gen_Read_binds :: (Name -> Fixity) -> SrcSpan -> TyCon -> (LHsBinds GhcPs, BagDerivStuff)
- gen_Data_binds :: SrcSpan -> TyCon -> TcM (LHsBinds GhcPs, BagDerivStuff)
- gen_Lift_binds :: SrcSpan -> TyCon -> (LHsBinds GhcPs, BagDerivStuff)
- gen_Newtype_binds :: SrcSpan -> Class -> [TyVar] -> [Type] -> Type -> TcM (LHsBinds GhcPs, BagDerivStuff)
- mkCoerceClassMethEqn :: Class -> [TyVar] -> [Type] -> Type -> Id -> Pair Type
- genAuxBinds :: DynFlags -> SrcSpan -> BagDerivStuff -> SeparateBagsDerivStuff
- ordOpTbl :: [(Type, (RdrName, RdrName, RdrName, RdrName, RdrName))]
- boxConTbl :: [(Type, RdrName)]
- litConTbl :: [(Type, LHsExpr GhcPs -> LHsExpr GhcPs)]
- mkRdrFunBind :: Located RdrName -> [LMatch GhcPs (LHsExpr GhcPs)] -> LHsBind GhcPs
- mkRdrFunBindEC :: Arity -> (LHsExpr GhcPs -> LHsExpr GhcPs) -> Located RdrName -> [LMatch GhcPs (LHsExpr GhcPs)] -> LHsBind GhcPs
- mkRdrFunBindSE :: Arity -> Located RdrName -> [LMatch GhcPs (LHsExpr GhcPs)] -> LHsBind GhcPs
- error_Expr :: String -> LHsExpr GhcPs

# Documentation

type BagDerivStuff = Bag DerivStuff #

data DerivStuff #

Constructors

DerivAuxBind AuxBindSpec |
DerivFamInst FamInst |
DerivHsBind (LHsBind GhcPs, LSig GhcPs) |

gen_Eq_binds :: SrcSpan -> TyCon -> TcM (LHsBinds GhcPs, BagDerivStuff) #

gen_Ord_binds :: SrcSpan -> TyCon -> TcM (LHsBinds GhcPs, BagDerivStuff) #

gen_Enum_binds :: SrcSpan -> TyCon -> TcM (LHsBinds GhcPs, BagDerivStuff) #

gen_Bounded_binds :: SrcSpan -> TyCon -> (LHsBinds GhcPs, BagDerivStuff) #

gen_Ix_binds :: SrcSpan -> TyCon -> TcM (LHsBinds GhcPs, BagDerivStuff) #

gen_Show_binds :: (Name -> Fixity) -> SrcSpan -> TyCon -> (LHsBinds GhcPs, BagDerivStuff) #

gen_Read_binds :: (Name -> Fixity) -> SrcSpan -> TyCon -> (LHsBinds GhcPs, BagDerivStuff) #

gen_Data_binds :: SrcSpan -> TyCon -> TcM (LHsBinds GhcPs, BagDerivStuff) #

gen_Lift_binds :: SrcSpan -> TyCon -> (LHsBinds GhcPs, BagDerivStuff) #

gen_Newtype_binds :: SrcSpan -> Class -> [TyVar] -> [Type] -> Type -> TcM (LHsBinds GhcPs, BagDerivStuff) #

mkCoerceClassMethEqn :: Class -> [TyVar] -> [Type] -> Type -> Id -> Pair Type #

genAuxBinds :: DynFlags -> SrcSpan -> BagDerivStuff -> SeparateBagsDerivStuff #

ordOpTbl :: [(Type, (RdrName, RdrName, RdrName, RdrName, RdrName))] #

boxConTbl :: [(Type, RdrName)] #

litConTbl :: [(Type, LHsExpr GhcPs -> LHsExpr GhcPs)] #

mkRdrFunBind :: Located RdrName -> [LMatch GhcPs (LHsExpr GhcPs)] -> LHsBind GhcPs #

mkRdrFunBindEC :: Arity -> (LHsExpr GhcPs -> LHsExpr GhcPs) -> Located RdrName -> [LMatch GhcPs (LHsExpr GhcPs)] -> LHsBind GhcPs #

Produces a function binding. When no equations are given, it generates a binding of the given arity and an empty case expression for the last argument that it passes to the given function to produce the right-hand side.

mkRdrFunBindSE :: Arity -> Located RdrName -> [LMatch GhcPs (LHsExpr GhcPs)] -> LHsBind GhcPs #

Produces a function binding. When there are no equations, it generates a binding with the given arity that produces an error based on the name of the type of the last argument.

error_Expr :: String -> LHsExpr GhcPs #