aboutsummaryrefslogtreecommitdiff
path: root/haddock-api/src
diff options
context:
space:
mode:
authorMateusz Kowalczyk <fuuzetsu@fuuzetsu.co.uk>2014-11-04 01:16:20 +0000
committerMateusz Kowalczyk <fuuzetsu@fuuzetsu.co.uk>2014-11-04 01:17:31 +0000
commit8d82524d9d9b278eae08993c2d4c54173d68481c (patch)
tree92e40bb22d7d98ca0266acc6234a4020ebc92ed7 /haddock-api/src
parent08a2651a20d66ad94ff7092ed0195be6b4e8f267 (diff)
Fix re-exports of built-in type families
Fixes #310
Diffstat (limited to 'haddock-api/src')
-rw-r--r--haddock-api/src/Haddock/Convert.hs11
1 files changed, 7 insertions, 4 deletions
diff --git a/haddock-api/src/Haddock/Convert.hs b/haddock-api/src/Haddock/Convert.hs
index 610e8fc6..ff7ca560 100644
--- a/haddock-api/src/Haddock/Convert.hs
+++ b/haddock-api/src/Haddock/Convert.hs
@@ -136,6 +136,7 @@ synifyAxiom ax@(CoAxiom { co_ax_tc = tc })
| otherwise
= error "synifyAxiom: closed/open family confusion"
+-- | Turn type constructors into type class declarations
synifyTyCon :: Maybe (CoAxiom br) -> TyCon -> TyClDecl Name
synifyTyCon coax tc
| isFunTyCon tc || isPrimTyCon tc
@@ -163,10 +164,12 @@ synifyTyCon coax tc
= case synTyConRhs_maybe tc of
Just rhs ->
let info = case rhs of
- OpenSynFamilyTyCon -> OpenTypeFamily
- ClosedSynFamilyTyCon (CoAxiom { co_ax_branches = branches }) ->
- ClosedTypeFamily (brListMap (noLoc . synifyAxBranch tc) branches)
- _ -> error "synifyTyCon: type/data family confusion"
+ OpenSynFamilyTyCon -> OpenTypeFamily
+ ClosedSynFamilyTyCon (CoAxiom { co_ax_branches = branches }) ->
+ ClosedTypeFamily (brListMap (noLoc . synifyAxBranch tc) branches)
+ BuiltInSynFamTyCon {} -> ClosedTypeFamily []
+ AbstractClosedSynFamilyTyCon {} -> ClosedTypeFamily []
+ _ -> error "synifyTyCon: type/data family confusion"
in FamDecl (FamilyDecl { fdInfo = info
, fdLName = synifyName tc
, fdTyVars = synifyTyVars (tyConTyVars tc)