import Literal ( Literal(..) )
import TyCon ( tyConDataCons )
import TysWiredIn ( tupleCon, listTyCon, charDataCon, intDataCon )
-import BasicTypes ( RecFlag(..), Boxity(..) )
+import BasicTypes ( RecFlag(..), Boxity(..), ipNameName )
import Maybes ( maybeToBool )
import PrelNames ( hasKey, ratioTyConKey )
import Util ( zipEqual, zipWithEqual )
-- We need to do a case right away, rather than building
-- a tuple and doing selections.
-- Silently ignore INLINE pragmas...
-dsLet (MonoBind (AbsBinds [] [] exports inlines binds) sigs is_rec) body
+dsLet bind@(MonoBind (AbsBinds [] [] exports inlines binds) sigs is_rec) body
| or [isUnLiftedType (idType g) | (_, g, l) <- exports]
= ASSERT (case is_rec of {NonRecursive -> True; other -> False})
-- Unlifted bindings are always non-recursive
dsGuarded grhss `thenDs` \ rhs ->
mk_error_app pat `thenDs` \ error_expr ->
matchSimply rhs PatBindRhs pat body_w_exports error_expr
+
+ other -> pprPanic "dsLet: unlifted" (ppr bind $$ ppr body)
where
body_w_exports = foldr bind_export body exports
bind_export (tvs, g, l) body = ASSERT( null tvs )
\begin{code}
dsExpr :: TypecheckedHsExpr -> DsM CoreExpr
-dsExpr (HsVar var) = returnDs (Var var)
-dsExpr (HsIPVar var) = returnDs (Var var)
-dsExpr (HsLit lit) = dsLit lit
+dsExpr (HsVar var) = returnDs (Var var)
+dsExpr (HsIPVar ip) = returnDs (Var (ipNameName ip))
+dsExpr (HsLit lit) = dsLit lit
-- HsOverLit has been gotten rid of by the type checker
dsExpr expr@(HsLam a_Match)
returnDs (Case core_discrim bndr alts)
_ -> panic ("dsExpr: tuple pattern:\n" ++ showSDoc (ppr matching_code))
where
- ubx_tuple_match (Match _ [TuplePat ps Unboxed] _ _) = True
+ ubx_tuple_match (Match [TuplePat ps Unboxed] _ _) = True
ubx_tuple_match _ = False
dsExpr (HsCase discrim matches src_loc)
where
dsIPBind body (n, e)
= dsExpr e `thenDs` \ e' ->
- returnDs (Let (NonRec n e') body)
+ returnDs (Let (NonRec (ipNameName n) e') body)
dsExpr (HsDoOut do_or_lc stmts return_id then_id fail_id result_ty src_loc)
| maybeToBool maybe_list_comp