summaryrefslogtreecommitdiff
path: root/compiler/GHC/Core
diff options
context:
space:
mode:
authorKrzysztof Gogolewski <krzysztof.gogolewski@tweag.io>2022-12-14 01:25:29 +0100
committerKrzysztof Gogolewski <krzysztof.gogolewski@tweag.io>2022-12-19 16:53:58 +0100
commit344f38fdfb61b5aa95df7f0c87a460200ce58a47 (patch)
tree6d72a6e18494a22f673ba2aea22db0924331cffb /compiler/GHC/Core
parent761c1f49f55afc9a9f290fafb48885c2033069ed (diff)
downloadhaskell-wip/misc-cleanup3.tar.gz
Misc cleanupwip/misc-cleanup3
- Remove unused uniques and hs-boot declarations - Fix types of seq and unsafeCoerce# - Remove FastString/String roundtrip in JS - Use TTG to enforce totality - Remove enumeration in Heap/Inspect; the 'otherwise' clause serves the primitive types well.
Diffstat (limited to 'compiler/GHC/Core')
-rw-r--r--compiler/GHC/Core/Coercion.hs-boot2
-rw-r--r--compiler/GHC/Core/Ppr.hs6
-rw-r--r--compiler/GHC/Core/Type.hs4
-rw-r--r--compiler/GHC/Core/Utils.hs3
4 files changed, 6 insertions, 9 deletions
diff --git a/compiler/GHC/Core/Coercion.hs-boot b/compiler/GHC/Core/Coercion.hs-boot
index 5d5193306e..0d56cf628c 100644
--- a/compiler/GHC/Core/Coercion.hs-boot
+++ b/compiler/GHC/Core/Coercion.hs-boot
@@ -45,8 +45,6 @@ coVarRole :: CoVar -> Role
mkCoercionType :: Role -> Type -> Type -> Type
-data LiftingContext
-liftCoSubst :: HasDebugCallStack => Role -> LiftingContext -> Type -> Coercion
seqCo :: Coercion -> ()
coercionKind :: Coercion -> Pair Type
diff --git a/compiler/GHC/Core/Ppr.hs b/compiler/GHC/Core/Ppr.hs
index 17559cf4a9..d5d21e294d 100644
--- a/compiler/GHC/Core/Ppr.hs
+++ b/compiler/GHC/Core/Ppr.hs
@@ -159,9 +159,9 @@ ppr_binding ann (val_bdr, expr)
-- So refer to printing j = e
= pp_normal_bind
where
- (bndrs, body) = collectBinders expr
- lhs_bndrs = take join_arity bndrs
- rhs = mkLams (drop join_arity bndrs) body
+ (bndrs, body) = collectBinders expr
+ (lhs_bndrs, rest) = splitAt join_arity bndrs
+ rhs = mkLams rest body
pprParendExpr expr = ppr_expr parens expr
pprCoreExpr expr = ppr_expr noParens expr
diff --git a/compiler/GHC/Core/Type.hs b/compiler/GHC/Core/Type.hs
index fdd5edbba2..bdf161bf75 100644
--- a/compiler/GHC/Core/Type.hs
+++ b/compiler/GHC/Core/Type.hs
@@ -781,7 +781,7 @@ isBoxedRuntimeRep_maybe rep
-- | Check whether a type of kind 'RuntimeRep' is lifted, unlifted, or unknown.
--
--- `isLiftedRuntimeRep rr` returns:
+-- `runtimeRepLevity_maybe rr` returns:
--
-- * `Just Lifted` if `rr` is `LiftedRep :: RuntimeRep`
-- * `Just Unlifted` if `rr` is definitely unlifted, e.g. `IntRep`
@@ -1028,7 +1028,7 @@ invariant: use it.
Note [Decomposing fat arrow c=>t]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Can we unify (a b) with (Eq a => ty)? If we do so, we end up with
-a partial application like ((=>) Eq a) which doesn't make sense in
+a partial application like ((=>) (Eq a)) which doesn't make sense in
source Haskell. In contrast, we *can* unify (a b) with (t1 -> t2).
Here's an example (#9858) of how you might do it:
i :: (Typeable a, Typeable b) => Proxy (a b) -> TypeRep
diff --git a/compiler/GHC/Core/Utils.hs b/compiler/GHC/Core/Utils.hs
index c88ddb3d55..32be6488b8 100644
--- a/compiler/GHC/Core/Utils.hs
+++ b/compiler/GHC/Core/Utils.hs
@@ -141,8 +141,7 @@ exprType (Lam binder expr) = mkLamType binder (exprType expr)
exprType e@(App _ _)
= case collectArgs e of
(fun, args) -> applyTypeToArgs (pprCoreExpr e) (exprType fun) args
-
-exprType other = pprPanic "exprType" (pprCoreExpr other)
+exprType (Type ty) = pprPanic "exprType" (ppr ty)
coreAltType :: CoreAlt -> Type
-- ^ Returns the type of the alternatives right hand side