diff options
author | Dr. ERDI Gergo <gergo@erdi.hu> | 2014-01-09 01:42:55 -0600 |
---|---|---|
committer | Austin Seipp <austin@well-typed.com> | 2014-01-19 15:35:16 -0600 |
commit | 7c905816eb12981840efe4136989799db437f357 (patch) | |
tree | 254618be017084ab4a1a61e499aae85ff4479b11 /src/Haddock/Convert.hs | |
parent | 764a6b85b686dee3d93e130bd650ee33a985aca2 (diff) |
Support for -XPatternSynonyms
Signed-off-by: Austin Seipp <austin@well-typed.com>
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 |