Skip to content
This repository was archived by the owner on Aug 3, 2024. It is now read-only.

Commit a53c131

Browse files
harpocratessjakobi
authored andcommitted
Detect GADTs properly and no foralls on GADT constructors
1 parent a8f64c6 commit a53c131

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

haddock-api/src/Haddock/Convert.hs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ synifyTyCon coax tc
239239
-- That seems like an acceptable compromise (they'll just be documented
240240
-- in prefix position), since, otherwise, the logic (at best) gets much more
241241
-- complicated. (would use dataConIsInfix.)
242-
use_gadt_syntax = any (not . isVanillaDataCon) (tyConDataCons tc)
242+
use_gadt_syntax = isGadtSyntaxTyCon tc
243243
consRaw = map (synifyDataCon use_gadt_syntax) (tyConDataCons tc)
244244
cons = rights consRaw
245245
-- "deriving" doesn't affect the signature, no need to specify any.
@@ -338,7 +338,7 @@ synifyDataCon use_gadt_syntax dc =
338338
then return $ noLoc $
339339
ConDeclGADT { con_g_ext = noExt
340340
, con_names = [name]
341-
, con_forall = noLoc True
341+
, con_forall = noLoc False
342342
, con_qvars = synifyTyVars (univ_tvs ++ ex_tvs)
343343
, con_mb_cxt = Just ctx
344344
, con_args = hat
@@ -347,7 +347,7 @@ synifyDataCon use_gadt_syntax dc =
347347
else return $ noLoc $
348348
ConDeclH98 { con_ext = noExt
349349
, con_name = name
350-
, con_forall = noLoc True
350+
, con_forall = noLoc False
351351
, con_ex_tvs = map synifyTyVar ex_tvs
352352
, con_mb_cxt = Just ctx
353353
, con_args = hat

0 commit comments

Comments
 (0)