summaryrefslogtreecommitdiff
path: root/compiler/GHC/Core
diff options
context:
space:
mode:
authorKrzysztof Gogolewski <krzysztof.gogolewski@tweag.io>2021-11-21 18:50:40 +0100
committerKrzysztof Gogolewski <krzysztof.gogolewski@tweag.io>2021-11-23 00:57:53 +0100
commitf3a62e2acda1c4b316e0a390227c90018ff2c299 (patch)
tree45b183959e81af8a62fbcfe8801eaaba0d3c610a /compiler/GHC/Core
parent742d8b6049c30f3b0cd1704d7a34d865bef41712 (diff)
downloadhaskell-wip/misc-fix.tar.gz
Misc cleanupwip/misc-fix
* Remove `getTag_RDR` (unused), `tidyKind` and `tidyOpenKind` (already available as `tidyType` and `tidyOpenType`) * Remove Note [Explicit Case Statement for Specificity]. Since 0a709dd9876e40 we require GHC 8.10 for bootstrapping. * Change the warning to `cmpAltCon` to a panic. This shouldn't happen. If it ever does, the code was wrong anyway: it shouldn't always return `LT`, but rather `LT` in one case and `GT` in the other case. * Rename `verifyLinearConstructors` to `verifyLinearFields` * Fix `Note [Local record selectors]` which was not referenced * Remove vestiges of `type +v` * Minor fixes to StaticPointers documentation, part of #15603
Diffstat (limited to 'compiler/GHC/Core')
-rw-r--r--compiler/GHC/Core/TyCo/Rep.hs6
-rw-r--r--compiler/GHC/Core/TyCo/Tidy.hs9
-rw-r--r--compiler/GHC/Core/TyCon.hs6
-rw-r--r--compiler/GHC/Core/Type.hs18
4 files changed, 6 insertions, 33 deletions
diff --git a/compiler/GHC/Core/TyCo/Rep.hs b/compiler/GHC/Core/TyCo/Rep.hs
index bb7280dd0d..31c8813e10 100644
--- a/compiler/GHC/Core/TyCo/Rep.hs
+++ b/compiler/GHC/Core/TyCo/Rep.hs
@@ -713,10 +713,8 @@ data TyCoBinder
instance Outputable TyCoBinder where
ppr (Anon af ty) = ppr af <+> ppr ty
ppr (Named (Bndr v Required)) = ppr v
- -- See Note [Explicit Case Statement for Specificity]
- ppr (Named (Bndr v (Invisible spec))) = case spec of
- SpecifiedSpec -> char '@' <> ppr v
- InferredSpec -> braces (ppr v)
+ ppr (Named (Bndr v Specified)) = char '@' <> ppr v
+ ppr (Named (Bndr v Inferred)) = braces (ppr v)
-- | 'TyBinder' is like 'TyCoBinder', but there can only be 'TyVarBinder'
diff --git a/compiler/GHC/Core/TyCo/Tidy.hs b/compiler/GHC/Core/TyCo/Tidy.hs
index 96cbed6ade..97d3adf8e0 100644
--- a/compiler/GHC/Core/TyCo/Tidy.hs
+++ b/compiler/GHC/Core/TyCo/Tidy.hs
@@ -8,12 +8,10 @@ module GHC.Core.TyCo.Tidy
-- * Tidying type related things up for printing
tidyType, tidyTypes,
tidyOpenType, tidyOpenTypes,
- tidyOpenKind,
tidyVarBndr, tidyVarBndrs, tidyFreeTyCoVars, avoidNameClashes,
tidyOpenTyCoVar, tidyOpenTyCoVars,
tidyTyCoVarOcc,
tidyTopType,
- tidyKind,
tidyCo, tidyCos,
tidyTyCoVarBinder, tidyTyCoVarBinders
) where
@@ -215,13 +213,6 @@ tidyTopType :: Type -> Type
tidyTopType ty = tidyType emptyTidyEnv ty
---------------
-tidyOpenKind :: TidyEnv -> Kind -> (TidyEnv, Kind)
-tidyOpenKind = tidyOpenType
-
-tidyKind :: TidyEnv -> Kind -> Kind
-tidyKind = tidyType
-
-----------------
-- | Tidy a Coercion
--
diff --git a/compiler/GHC/Core/TyCon.hs b/compiler/GHC/Core/TyCon.hs
index 24807945cc..e267932e14 100644
--- a/compiler/GHC/Core/TyCon.hs
+++ b/compiler/GHC/Core/TyCon.hs
@@ -680,10 +680,8 @@ instance OutputableBndr tv => Outputable (VarBndr tv TyConBndrVis) where
ppr_bi (AnonTCB VisArg) = text "anon-vis"
ppr_bi (AnonTCB InvisArg) = text "anon-invis"
ppr_bi (NamedTCB Required) = text "req"
- -- See Note [Explicit Case Statement for Specificity]
- ppr_bi (NamedTCB (Invisible spec)) = case spec of
- SpecifiedSpec -> text "spec"
- InferredSpec -> text "inf"
+ ppr_bi (NamedTCB Specified) = text "spec"
+ ppr_bi (NamedTCB Inferred) = text "inf"
instance Binary TyConBndrVis where
put_ bh (AnonTCB af) = do { putByte bh 0; put_ bh af }
diff --git a/compiler/GHC/Core/Type.hs b/compiler/GHC/Core/Type.hs
index cf671657b0..85cc635791 100644
--- a/compiler/GHC/Core/Type.hs
+++ b/compiler/GHC/Core/Type.hs
@@ -222,12 +222,10 @@ module GHC.Core.Type (
-- * Tidying type related things up for printing
tidyType, tidyTypes,
tidyOpenType, tidyOpenTypes,
- tidyOpenKind,
tidyVarBndr, tidyVarBndrs, tidyFreeTyCoVars,
tidyOpenTyCoVar, tidyOpenTyCoVars,
tidyTyCoVarOcc,
tidyTopType,
- tidyKind,
tidyTyCoVarBinder, tidyTyCoVarBinders,
-- * Kinds
@@ -3541,22 +3539,10 @@ tyConAppNeedsKindSig spec_inj_pos tc n_args
_ -> emptyFV
source_of_injectivity Required = True
- -- See Note [Explicit Case Statement for Specificity]
- source_of_injectivity (Invisible spec) = case spec of
- SpecifiedSpec -> spec_inj_pos
- InferredSpec -> False
+ source_of_injectivity Specified = spec_inj_pos
+ source_of_injectivity Inferred = False
{-
-Note [Explicit Case Statement for Specificity]
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-When pattern matching against an `ArgFlag`, you should not pattern match against
-the pattern synonyms 'Specified' or 'Inferred', as this results in a
-non-exhaustive pattern match warning.
-Instead, pattern match against 'Invisible spec' and do another case analysis on
-this specificity argument.
-The issue has been fixed in GHC 8.10 (ticket #17876). This hack can thus be
-dropped once version 8.10 is used as the minimum version for building GHC.
-
Note [When does a tycon application need an explicit kind signature?]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
There are a couple of places in GHC where we convert Core Types into forms that