haddock

Portability | portable
Stability | experimental
Maintainer | haddock@projects.haskell.org
Safe Haskell | Safe-Infered

Haddock.Convert

Description

Conversion between TyThing and HsDecl. This functionality may be moved into GHC at some point.

# Documentation

tyThingToLHsDecl :: TyThing -> LHsDecl Name

synifyATDefault :: TyCon -> LTyClDecl Name

synifyAxiom :: CoAxiom -> TyClDecl Name

synifyTyCon :: TyCon -> TyClDecl Name

synifyDataCon :: Bool -> DataCon -> LConDecl Name

synifyName :: NamedThing n => n -> Located Name

synifyIdSig :: SynifyTypeState -> Id -> Sig Name

synifyCtx :: [PredType] -> LHsContext Name

synifyTyVars :: [TyVar] -> [LHsTyVarBndr Name]

data SynifyTypeState

Constructors

WithinType | normal situation. This is the safe one to use if you don't quite understand what's going on.
ImplicitizeForAll | beginning of a function definition, in which, to make it look less ugly, those rank-1 foralls are made implicit.
DeleteTopLevelQuantification | because in class methods the context is added to the type (e.g. adding `forall a. Num a =>` to `(+) :: a -> a -> a`) which is rather sensible, but we want to restore things to the source-syntax situation where the defining class gets to quantify all its functions for free!

synifyType :: SynifyTypeState -> Type -> LHsType Name

synifyKind :: Kind -> LHsKind Name

synifyInstHead :: ([TyVar], [PredType], Class, [Type]) -> ([HsType Name], Name, [HsType Name])