summaryrefslogtreecommitdiff
path: root/compiler/GHC/Core
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/GHC/Core')
-rw-r--r--compiler/GHC/Core/Make.hs17
-rw-r--r--compiler/GHC/Core/Opt/WorkWrap.hs4
-rw-r--r--compiler/GHC/Core/Type.hs2
3 files changed, 10 insertions, 13 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
diff --git a/compiler/GHC/Core/Opt/WorkWrap.hs b/compiler/GHC/Core/Opt/WorkWrap.hs
index 1ed95703af..29f1e3973f 100644
--- a/compiler/GHC/Core/Opt/WorkWrap.hs
+++ b/compiler/GHC/Core/Opt/WorkWrap.hs
@@ -68,9 +68,7 @@ info for exported values).
wwTopBinds :: WwOpts -> UniqSupply -> CoreProgram -> CoreProgram
wwTopBinds ww_opts us top_binds
- = initUs_ us $ do
- top_binds' <- mapM (wwBind ww_opts) top_binds
- return (concat top_binds')
+ = initUs_ us $ concatMapM (wwBind ww_opts) top_binds
{-
************************************************************************
diff --git a/compiler/GHC/Core/Type.hs b/compiler/GHC/Core/Type.hs
index e16ff2faa6..c35c534dea 100644
--- a/compiler/GHC/Core/Type.hs
+++ b/compiler/GHC/Core/Type.hs
@@ -770,7 +770,7 @@ isBoxedRuntimeRep rep = isJust (isBoxedRuntimeRep_maybe rep)
-- expands to `Boxed lev` and returns `Nothing` otherwise.
--
-- Types with this runtime rep are represented by pointers on the GC'd heap.
-isBoxedRuntimeRep_maybe :: RuntimeRepType -> Maybe Type
+isBoxedRuntimeRep_maybe :: RuntimeRepType -> Maybe LevityType
isBoxedRuntimeRep_maybe rep
| Just (rr_tc, args) <- splitRuntimeRep_maybe rep
, rr_tc `hasKey` boxedRepDataConKey