import DataCon ( DataCon, StrictnessMark, maybeMarkedUnboxed,
dataConStrictMarks, dataConId, splitProductType_maybe
)
-import Type ( mkFunTy, isUnLiftedType, splitAlgTyConApp, unUsgTy,
+import Type ( mkFunTy, isUnLiftedType, splitAlgTyConApp,
Type
)
import TysPrim ( intPrimTy, charPrimTy, floatPrimTy, doublePrimTy )
-- Stuff for newtype
(_, arg_ids, match_result) = head match_alts
arg_id = head arg_ids
- coercion_bind = NonRec arg_id (Note (Coerce (unUsgTy (idType arg_id))
- (unUsgTy scrut_ty))
+ coercion_bind = NonRec arg_id (Note (Coerce (idType arg_id)
+ scrut_ty)
(Var var))
newtype_sanity = null (tail match_alts) && null (tail arg_ids)
full_msg = showSDoc (hcat [ppr src_loc, text "|", text msg])
in
mkStringLit full_msg `thenDs` \ core_msg ->
- returnDs (mkApps (Var err_id) [(Type . unUsgTy) ty, core_msg])
- -- unUsgTy *required* -- KSW 1999-04-07
+ returnDs (mkApps (Var err_id) [Type ty, core_msg])
\end{code}
| otherwise
= mkErrorAppDs iRREFUT_PAT_ERROR_ID tuple_ty (showSDoc (ppr pat))
`thenDs` \ error_expr ->
- matchSimply val_expr LetMatch pat local_tuple error_expr
+ matchSimply val_expr PatBindRhs pat local_tuple error_expr
`thenDs` \ tuple_expr ->
newSysLocalDs tuple_ty
`thenDs` \ tuple_var ->
-- (mk_bind sv bv) generates
-- bv = case sv of { pat -> bv; other -> error-msg }
-- Remember, pat binds bv
- = matchSimply (Var scrut_var) LetMatch pat
+ = matchSimply (Var scrut_var) PatBindRhs pat
(Var bndr_var) error_expr `thenDs` \ rhs_expr ->
returnDs (bndr_var, rhs_expr)
where
@mkTupleExpr@ builds a tuple; the inverse to @mkTupleSelector@. If it
-has only one element, it is the identity function. Notice we must
-throw out any usage annotation on the outside of an Id.
+has only one element, it is the identity function.
\begin{code}
mkTupleExpr :: [Id] -> CoreExpr
mkTupleExpr [] = Var unitDataConId
mkTupleExpr [id] = Var id
mkTupleExpr ids = mkConApp (tupleCon Boxed (length ids))
- (map (Type . unUsgTy . idType) ids ++ [ Var i | i <- ids ])
+ (map (Type . idType) ids ++ [ Var i | i <- ids ])
\end{code}