From 7c905816eb12981840efe4136989799db437f357 Mon Sep 17 00:00:00 2001 From: "Dr. ERDI Gergo" Date: Thu, 9 Jan 2014 01:42:55 -0600 Subject: Support for -XPatternSynonyms Signed-off-by: Austin Seipp --- src/Haddock/Convert.hs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src/Haddock/Convert.hs') 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 -- cgit v1.2.3