aboutsummaryrefslogtreecommitdiff
path: root/haddock-api/src/Haddock/GhcUtils.hs
diff options
context:
space:
mode:
authorAlan Zimmerman <alan.zimm@gmail.com>2020-10-06 18:38:35 +0100
committerAlan Zimmerman <alan.zimm@gmail.com>2020-10-19 08:57:27 +0100
commita7d1d8e034d25612d5d08ed8fdbf6f472aded4a1 (patch)
tree9d4d2c25af988627af00eebccadd1410ad32d463 /haddock-api/src/Haddock/GhcUtils.hs
parent77261e89c31b41eb5d7f1d16bb1de5b14b4296f4 (diff)
Match GHC, adding IsUnicodeSyntax field to HsFunTy and HsScaled
Diffstat (limited to 'haddock-api/src/Haddock/GhcUtils.hs')
-rw-r--r--haddock-api/src/Haddock/GhcUtils.hs7
1 files changed, 4 insertions, 3 deletions
diff --git a/haddock-api/src/Haddock/GhcUtils.hs b/haddock-api/src/Haddock/GhcUtils.hs
index b4964d9f..a03587b4 100644
--- a/haddock-api/src/Haddock/GhcUtils.hs
+++ b/haddock-api/src/Haddock/GhcUtils.hs
@@ -44,6 +44,7 @@ import GHC.Types.Var.Env ( TyVarEnv, extendVarEnv, elemVarEnv, emptyVarEnv )
import GHC.Core.TyCo.Rep ( Type(..) )
import GHC.Core.Type ( isRuntimeRepVar )
import GHC.Builtin.Types( liftedRepDataConTyCon )
+import GHC.Parser.Annotation (IsUnicodeSyntax(..))
import GHC.Data.StringBuffer ( StringBuffer )
import qualified GHC.Data.StringBuffer as S
@@ -156,13 +157,13 @@ getGADTConType (ConDeclGADT { con_forall = L _ has_forall
| otherwise
= tau_ty
--- tau_ty :: LHsType DocNameI
+-- tau_ty :: LHsType DocNameI
tau_ty = case args of
RecCon flds -> mkFunTy (noLoc (HsRecTy noExtField (unLoc flds))) res_ty
PrefixCon pos_args -> foldr mkFunTy res_ty (map hsScaledThing pos_args)
InfixCon arg1 arg2 -> (hsScaledThing arg1) `mkFunTy` ((hsScaledThing arg2) `mkFunTy` res_ty)
- mkFunTy a b = noLoc (HsFunTy noExtField HsUnrestrictedArrow a b)
+ mkFunTy a b = noLoc (HsFunTy noExtField (HsUnrestrictedArrow NormalSyntax) a b)
getGADTConType (ConDeclH98 {}) = panic "getGADTConType"
-- Should only be called on ConDeclGADT
@@ -218,7 +219,7 @@ getGADTConTypeG (ConDeclGADT { con_forall = L _ has_forall
InfixCon arg1 arg2 -> (hsScaledThing arg1) `mkFunTy` ((hsScaledThing arg2) `mkFunTy` res_ty)
-- mkFunTy :: LHsType DocNameI -> LHsType DocNameI -> LHsType DocNameI
- mkFunTy a b = noLoc (HsFunTy noExtField HsUnrestrictedArrow a b)
+ mkFunTy a b = noLoc (HsFunTy noExtField (HsUnrestrictedArrow NormalSyntax) a b)
getGADTConTypeG (ConDeclH98 {}) = panic "getGADTConTypeG"
-- Should only be called on ConDeclGADT