TcValidity

ghc-7.10.3: The GHC API

Safe Haskell | None
Language | Haskell2010

TcValidity

Synopsis

- data Rank
- data UserTypeCtxt
  - = FunSigCtxt Name
  - | InfSigCtxt Name
  - | ExprSigCtxt
  - | ConArgCtxt Name
  - | TySynCtxt Name
  - | PatSigCtxt
  - | RuleSigCtxt Name
  - | ResSigCtxt
  - | ForSigCtxt Name
  - | DefaultDeclCtxt
  - | InstDeclCtxt
  - | SpecInstCtxt
  - | ThBrackCtxt
  - | GenSigCtxt
  - | GhciCtxt
  - | ClassSCCtxt Name
  - | SigmaCtxt
  - | DataTyCtxt Name
- checkValidType :: UserTypeCtxt -> Type -> TcM ()
- checkValidMonoType :: Type -> TcM ()
- expectedKindInCtxt :: UserTypeCtxt -> Maybe Kind
- checkValidTheta :: UserTypeCtxt -> ThetaType -> TcM ()
- checkValidFamPats :: TyCon -> [TyVar] -> [Type] -> TcM ()
- checkValidInstance :: UserTypeCtxt -> LHsType Name -> Type -> TcM ([TyVar], ThetaType, Class, [Type])
- validDerivPred :: TyVarSet -> PredType -> Bool
- checkInstTermination :: [TcType] -> ThetaType -> TcM ()
- checkValidTyFamInst :: Maybe (Class, VarEnv Type) -> TyCon -> CoAxBranch -> TcM ()
- checkTyFamFreeness :: Type -> TcM ()
- checkValidTyFamEqn :: Maybe ClsInfo -> TyCon -> [TyVar] -> [Type] -> Type -> SrcSpan -> TcM ()
- checkConsistentFamInst :: Maybe (Class, VarEnv Type) -> TyCon -> [TyVar] -> [Type] -> TcM ()
- arityErr :: Outputable a => String -> a -> Int -> Int -> SDoc
- badATErr :: Name -> Name -> SDoc
- type ClsInfo = (Class, VarEnv Type)

# Documentation

data Rank

data UserTypeCtxt

Constructors

FunSigCtxt Name |
InfSigCtxt Name |
ExprSigCtxt |
ConArgCtxt Name |
TySynCtxt Name |
PatSigCtxt |
RuleSigCtxt Name |
ResSigCtxt |
ForSigCtxt Name |
DefaultDeclCtxt |
InstDeclCtxt |
SpecInstCtxt |
ThBrackCtxt |
GenSigCtxt |
GhciCtxt |
ClassSCCtxt Name |
SigmaCtxt |
DataTyCtxt Name |

checkValidType :: UserTypeCtxt -> Type -> TcM ()

checkValidMonoType :: Type -> TcM ()

expectedKindInCtxt :: UserTypeCtxt -> Maybe Kind

checkValidTheta :: UserTypeCtxt -> ThetaType -> TcM ()

checkValidFamPats :: TyCon -> [TyVar] -> [Type] -> TcM ()

checkValidInstance :: UserTypeCtxt -> LHsType Name -> Type -> TcM ([TyVar], ThetaType, Class, [Type])

validDerivPred :: TyVarSet -> PredType -> Bool

checkInstTermination :: [TcType] -> ThetaType -> TcM ()

checkValidTyFamInst :: Maybe (Class, VarEnv Type) -> TyCon -> CoAxBranch -> TcM ()

checkTyFamFreeness :: Type -> TcM ()

checkValidTyFamEqn

Arguments

:: Maybe ClsInfo |
-> TyCon | of the type family
-> [TyVar] | bound tyvars in the equation
-> [Type] | type patterns
-> Type | rhs
-> SrcSpan |
-> TcM () |

Do validity checks on a type family equation, including consistency with any enclosing class instance head, termination, and lack of polytypes.

checkConsistentFamInst

Arguments

:: Maybe (Class, VarEnv Type) | Class of associated type and instantiation of class TyVars
-> TyCon | Family tycon
-> [TyVar] | Type variables of the family instance
-> [Type] | Type patterns from instance
-> TcM () |

arityErr :: Outputable a => String -> a -> Int -> Int -> SDoc

badATErr :: Name -> Name -> SDoc

type ClsInfo = (Class, VarEnv Type)

Extra information needed when type-checking associated types. The `Class` is the enclosing class, and the `VarEnv Type` maps class variables to their instance types.