summaryrefslogtreecommitdiff
path: root/compiler/GHC/Core/Make.hs
diff options
context:
space:
mode:
authorKrzysztof Gogolewski <krzysztof.gogolewski@tweag.io>2023-01-10 19:41:43 +0100
committerKrzysztof Gogolewski <krzysztof.gogolewski@tweag.io>2023-01-10 19:44:11 +0100
commit627a288b216defe0d66efc060b79db4fbd8c47e5 (patch)
tree43c06b59c290874263ba31b7f3099bb3407bcf38 /compiler/GHC/Core/Make.hs
parent146a145835f5c2e82da4dd0bcb90702460505a01 (diff)
downloadhaskell-wip/misc-cleanup4.tar.gz
Misc cleanupwip/misc-cleanup4
- Remove unused mkWildEvBinder - Use typeTypeOrConstraint - more symmetric and asserts that that the type is Type or Constraint - Fix escape sequences in Python; they raise a deprecation warning with -Wdefault
Diffstat (limited to 'compiler/GHC/Core/Make.hs')
-rw-r--r--compiler/GHC/Core/Make.hs17
1 files changed, 8 insertions, 9 deletions
diff --git a/compiler/GHC/Core/Make.hs b/compiler/GHC/Core/Make.hs
index 2d567786ea..abd28baa47 100644
--- a/compiler/GHC/Core/Make.hs
+++ b/compiler/GHC/Core/Make.hs
@@ -6,7 +6,7 @@ module GHC.Core.Make (
mkCoreLet, mkCoreLets,
mkCoreApp, mkCoreApps, mkCoreConApps,
mkCoreLams, mkWildCase, mkIfThenElse,
- mkWildValBinder, mkWildEvBinder,
+ mkWildValBinder,
mkSingleAltCase,
sortQuantVars, castBottomExpr,
@@ -54,7 +54,7 @@ import GHC.Prelude
import GHC.Platform
import GHC.Types.Id
-import GHC.Types.Var ( EvVar, setTyVarUnique, visArgConstraintLike )
+import GHC.Types.Var ( setTyVarUnique, visArgConstraintLike )
import GHC.Types.TyThing
import GHC.Types.Id.Info
import GHC.Types.Cpr
@@ -173,9 +173,6 @@ mkCoreAppTyped d (fun, fun_ty) arg
* *
********************************************************************* -}
-mkWildEvBinder :: PredType -> EvVar
-mkWildEvBinder pred = mkWildValBinder ManyTy pred
-
-- | Make a /wildcard binder/. This is typically used when you need a binder
-- that you expect to use only at a *binding* site. Do not use it at
-- occurrence sites because it has a single, fixed unique, and it's very
@@ -1082,8 +1079,9 @@ mkImpossibleExpr :: Type -> String -> CoreExpr
mkImpossibleExpr res_ty str
= mkRuntimeErrorApp err_id res_ty str
where -- See Note [Type vs Constraint for error ids]
- err_id | isConstraintLikeKind (typeKind res_ty) = iMPOSSIBLE_CONSTRAINT_ERROR_ID
- | otherwise = iMPOSSIBLE_ERROR_ID
+ err_id = case typeTypeOrConstraint res_ty of
+ TypeLike -> iMPOSSIBLE_ERROR_ID
+ ConstraintLike -> iMPOSSIBLE_CONSTRAINT_ERROR_ID
{- Note [Type vs Constraint for error ids]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -1207,8 +1205,9 @@ mkAbsentErrorApp :: Type -- The type to instantiate 'a'
mkAbsentErrorApp res_ty err_msg
= mkApps (Var err_id) [ Type res_ty, err_string ]
where
- err_id | isConstraintLikeKind (typeKind res_ty) = aBSENT_CONSTRAINT_ERROR_ID
- | otherwise = aBSENT_ERROR_ID
+ err_id = case typeTypeOrConstraint res_ty of
+ TypeLike -> aBSENT_ERROR_ID
+ ConstraintLike -> aBSENT_CONSTRAINT_ERROR_ID
err_string = Lit (mkLitString err_msg)
absentErrorName, absentConstraintErrorName :: Name