summaryrefslogtreecommitdiff
path: root/compiler/GHC/Rename
diff options
context:
space:
mode:
authorVladislav Zavialov <vlad.z.4096@gmail.com>2021-06-01 13:46:39 +0300
committerMarge Bot <ben+marge-bot@smart-cactus.org>2021-06-16 20:19:10 -0400
commita2e4cb80db1b63ea2c5e0ab501acec7fb1b116e3 (patch)
tree5d0ef3df75a255a817d611fef555812f3223cc8a /compiler/GHC/Rename
parent6c131ba04ab1455827d985704e4411aa19185f5f (diff)
downloadhaskell-a2e4cb80db1b63ea2c5e0ab501acec7fb1b116e3.tar.gz
HsUniToken and HsToken for HsArrow (#19623)
Another step towards a simpler design for exact printing. Updates the haddock submodule.
Diffstat (limited to 'compiler/GHC/Rename')
-rw-r--r--compiler/GHC/Rename/HsType.hs15
-rw-r--r--compiler/GHC/Rename/Module.hs4
-rw-r--r--compiler/GHC/Rename/Names.hs2
3 files changed, 11 insertions, 10 deletions
diff --git a/compiler/GHC/Rename/HsType.hs b/compiler/GHC/Rename/HsType.hs
index 92228b0003..ea4ac365b1 100644
--- a/compiler/GHC/Rename/HsType.hs
+++ b/compiler/GHC/Rename/HsType.hs
@@ -764,10 +764,11 @@ rnHsTyKi env (HsWildCardTy _)
; return (HsWildCardTy noExtField, emptyFVs) }
rnHsArrow :: RnTyKiEnv -> HsArrow GhcPs -> RnM (HsArrow GhcRn, FreeVars)
-rnHsArrow _env (HsUnrestrictedArrow u) = return (HsUnrestrictedArrow u, emptyFVs)
-rnHsArrow _env (HsLinearArrow u a) = return (HsLinearArrow u a, emptyFVs)
-rnHsArrow env (HsExplicitMult u a p)
- = (\(mult, fvs) -> (HsExplicitMult u a mult, fvs)) <$> rnLHsTyKi env p
+rnHsArrow _env (HsUnrestrictedArrow arr) = return (HsUnrestrictedArrow arr, emptyFVs)
+rnHsArrow _env (HsLinearArrow (HsPct1 pct1 arr)) = return (HsLinearArrow (HsPct1 pct1 arr), emptyFVs)
+rnHsArrow _env (HsLinearArrow (HsLolly arr)) = return (HsLinearArrow (HsLolly arr), emptyFVs)
+rnHsArrow env (HsExplicitMult pct p arr)
+ = (\(mult, fvs) -> (HsExplicitMult pct mult arr, fvs)) <$> rnLHsTyKi env p
{-
Note [Renaming HsCoreTys]
@@ -1891,8 +1892,8 @@ extractRdrKindSigVars (L _ resultSig) = case resultSig of
extractConDeclGADTDetailsTyVars ::
HsConDeclGADTDetails GhcPs -> FreeKiTyVars -> FreeKiTyVars
extractConDeclGADTDetailsTyVars con_args = case con_args of
- PrefixConGADT args -> extract_scaled_ltys args
- RecConGADT (L _ flds) -> extract_ltys $ map (cd_fld_type . unLoc) $ flds
+ PrefixConGADT args -> extract_scaled_ltys args
+ RecConGADT (L _ flds) _ -> extract_ltys $ map (cd_fld_type . unLoc) $ flds
-- | Get type/kind variables mentioned in the kind signature, preserving
-- left-to-right order:
@@ -1966,7 +1967,7 @@ extract_lhs_sig_ty (L _ (HsSig{sig_bndrs = outer_bndrs, sig_body = body})) =
extract_hs_arrow :: HsArrow GhcPs -> FreeKiTyVars ->
FreeKiTyVars
-extract_hs_arrow (HsExplicitMult _ _ p) acc = extract_lty p acc
+extract_hs_arrow (HsExplicitMult _ p _) acc = extract_lty p acc
extract_hs_arrow _ acc = acc
extract_hs_for_all_telescope :: HsForAllTelescope GhcPs
diff --git a/compiler/GHC/Rename/Module.hs b/compiler/GHC/Rename/Module.hs
index 61aa6a54d2..55cc83456e 100644
--- a/compiler/GHC/Rename/Module.hs
+++ b/compiler/GHC/Rename/Module.hs
@@ -2389,9 +2389,9 @@ rnConDeclGADTDetails ::
rnConDeclGADTDetails _ doc (PrefixConGADT tys)
= do { (new_tys, fvs) <- mapFvRn (rnScaledLHsType doc) tys
; return (PrefixConGADT new_tys, fvs) }
-rnConDeclGADTDetails con doc (RecConGADT flds)
+rnConDeclGADTDetails con doc (RecConGADT flds arr)
= do { (new_flds, fvs) <- rnRecConDeclFields con doc flds
- ; return (RecConGADT new_flds, fvs) }
+ ; return (RecConGADT new_flds arr, fvs) }
rnRecConDeclFields ::
Name
diff --git a/compiler/GHC/Rename/Names.hs b/compiler/GHC/Rename/Names.hs
index 6d4806fe47..05bbb71c6e 100644
--- a/compiler/GHC/Rename/Names.hs
+++ b/compiler/GHC/Rename/Names.hs
@@ -888,7 +888,7 @@ getLocalNonValBinders fixity_env
= [( find_con_name rdr
, concatMap find_con_decl_flds (unLoc cdflds) )]
find_con_flds (L _ (ConDeclGADT { con_names = rdrs
- , con_g_args = RecConGADT flds }))
+ , con_g_args = RecConGADT flds _ }))
= [ ( find_con_name rdr
, concatMap find_con_decl_flds (unLoc flds))
| L _ rdr <- rdrs ]