aboutsummaryrefslogtreecommitdiff
path: root/haddock-api/src/Haddock/Convert.hs
diff options
context:
space:
mode:
authorAlec Theriault <alec.theriault@gmail.com>2018-08-21 11:24:56 -0700
committerAlec Theriault <alec.theriault@gmail.com>2018-08-21 22:06:40 -0700
commitbf9da9cddc3d6161367bdc8710afc4fe08c3bdfd (patch)
treeabd9190eba367f7767f3d74b7aae6efa400cfe2b /haddock-api/src/Haddock/Convert.hs
parentb417271702b81d7893308c3ce6df4b5babeaa55c (diff)
Handle promoted tuples in 'synifyType'
When we have a fully applied promoted tuple, we can expand it out properly.
Diffstat (limited to 'haddock-api/src/Haddock/Convert.hs')
-rw-r--r--haddock-api/src/Haddock/Convert.hs4
1 files changed, 4 insertions, 0 deletions
diff --git a/haddock-api/src/Haddock/Convert.hs b/haddock-api/src/Haddock/Convert.hs
index 71482f22..622837fa 100644
--- a/haddock-api/src/Haddock/Convert.hs
+++ b/haddock-api/src/Haddock/Convert.hs
@@ -458,6 +458,10 @@ synifyType _ (TyConApp tc tys)
UnboxedTuple -> HsUnboxedTuple)
(map (synifyType WithinType) vis_tys)
| isUnboxedSumTyCon tc = noLoc $ HsSumTy noExt (map (synifyType WithinType) vis_tys)
+ | Just dc <- isPromotedDataCon_maybe tc
+ , isTupleDataCon dc
+ , dataConSourceArity dc == length vis_tys
+ = noLoc $ HsExplicitTupleTy noExt (map (synifyType WithinType) vis_tys)
-- ditto for lists
| getName tc == listTyConName, [ty] <- tys =
noLoc $ HsListTy noExt (synifyType WithinType ty)