diff options
Diffstat (limited to 'src/Haddock/Convert.hs')
-rw-r--r-- | src/Haddock/Convert.hs | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/Haddock/Convert.hs b/src/Haddock/Convert.hs index 0f7e5b9c..66497783 100644 --- a/src/Haddock/Convert.hs +++ b/src/Haddock/Convert.hs @@ -27,7 +27,9 @@ import Var import Class import TyCon import CoAxiom +import ConLike import DataCon +import PatSyn import BasicTypes ( TupleSort(..) ) import TysPrim ( alphaTyVars ) import TysWiredIn ( listTyConName, eqTyCon ) @@ -85,9 +87,17 @@ tyThingToLHsDecl t = noLoc $ case t of ACoAxiom ax -> synifyAxiom ax -- a data-constructor alone just gets rendered as a function: - ADataCon dc -> SigD (TypeSig [synifyName dc] + AConLike (RealDataCon dc) -> SigD (TypeSig [synifyName dc] (synifyType ImplicitizeForAll (dataConUserType dc))) + AConLike (PatSynCon ps) -> + let (_, _, (req_theta, prov_theta)) = patSynSig ps + in SigD $ PatSynSig (synifyName ps) + (fmap (synifyType WithinType) (patSynTyDetails ps)) + (synifyType WithinType (patSynType ps)) + (synifyCtx req_theta) + (synifyCtx prov_theta) + synifyAxBranch :: TyCon -> CoAxBranch -> TyFamInstEqn Name synifyAxBranch tc (CoAxBranch { cab_tvs = tkvs, cab_lhs = args, cab_rhs = rhs }) = let name = synifyName tc |