diff options
author | Alan Zimmerman <alan.zimm@gmail.com> | 2015-12-05 17:33:52 +0200 |
---|---|---|
committer | Alan Zimmerman <alan.zimm@gmail.com> | 2015-12-05 17:33:52 +0200 |
commit | 222954753de7a8a3708baff1d75a4b7c3a675f4b (patch) | |
tree | b401b755a1961048001dd36e622cac0526b5a1d6 /haddock-api/src/Haddock/Convert.hs | |
parent | a6deefad581cbeb62048826bc1d626c41a0dd56c (diff) |
Matching changes for #11028
Diffstat (limited to 'haddock-api/src/Haddock/Convert.hs')
-rw-r--r-- | haddock-api/src/Haddock/Convert.hs | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/haddock-api/src/Haddock/Convert.hs b/haddock-api/src/Haddock/Convert.hs index 49c471a4..8983cc77 100644 --- a/haddock-api/src/Haddock/Convert.hs +++ b/haddock-api/src/Haddock/Convert.hs @@ -292,19 +292,21 @@ synifyDataCon use_gadt_syntax dc = (False,True) -> case linear_tys of [a,b] -> return $ InfixCon a b _ -> Left "synifyDataCon: infix with non-2 args?" - hs_res_ty = if use_gadt_syntax - then ResTyGADT noSrcSpan (synifyType WithinType res_ty) - else ResTyH98 + gadt_ty = HsIB [] [] (synifyType WithinType res_ty) -- finally we get synifyDataCon's result! in hs_arg_tys >>= - \hat -> return $ noLoc $ - ConDecl { con_names = [name] - , con_explicit = False -- we don't know nor care - , con_qvars = qvars - , con_cxt = ctx - , con_details = hat - , con_res = hs_res_ty - , con_doc = Nothing } + \hat -> + if use_gadt_syntax + then return $ noLoc $ + ConDeclGADT { con_names = [name] + , con_type = gadt_ty + , con_doc = Nothing } + else return $ noLoc $ + ConDeclH98 { con_name = name + , con_qvars = Just qvars + , con_cxt = Just ctx + , con_details = hat + , con_doc = Nothing } synifyName :: NamedThing n => n -> Located Name synifyName = noLoc . getName |