import Bag
import IdInfo
import Name ( nameUnique, isLocalName, mkSysLocalName,
- isWiredInName, setNameVisibility,
+ isWiredInName, setNameVisibility, changeUnique,
ExportFlag(..), Provenance,
OccName(..), Name, Module,
NamedThing(..)
where
pp_vars lam pp [] = empty
pp_vars lam pp vs
- = hsep [ptext lam, hsep (map pp vs), ptext SLIT("->")]
+ = hsep [ptext lam, vcat (map pp vs), ptext SLIT("->")]
ppr_expr pe expr@(App fun arg)
= let
ppr_parend_expr pe expr ]
ppr_expr pe (Note (Coerce to_ty from_ty) expr)
- = sep [hsep [ptext SLIT("_coerce_"), pTy pe to_ty, pTy pe from_ty],
+ = sep [hsep [ptext SLIT("_coerce_"), pTy pe to_ty],
ppr_parend_expr pe expr]
ppr_expr pe (Note InlineCall expr)
mapTc tcCoreArg args `thenTc` \ args' ->
returnTc (Prim primop args')
+tcCoreExpr (UfLam bndr body)
+ = tcCoreLamBndr bndr $ \ bndr' ->
+ tcCoreExpr body `thenTc` \ body' ->
+ returnTc (Lam bndr' body')
+
tcCoreExpr (UfApp fun arg)
= tcCoreExpr fun `thenTc` \ fun' ->
tcCoreArg arg `thenTc` \ arg' ->
tcCoreAlts (coreExprType scrut') alts `thenTc` \ alts' ->
returnTc (Case scrut' alts')
+tcCoreExpr (UfLet (UfNonRec bndr rhs) body)
+ = tcCoreExpr rhs `thenTc` \ rhs' ->
+ tcCoreValBndr bndr $ \ bndr' ->
+ tcCoreExpr body `thenTc` \ body' ->
+ returnTc (Let (NonRec bndr' rhs') body')
+
+tcCoreExpr (UfLet (UfRec pairs) body)
+ = tcCoreValBndrs bndrs $ \ bndrs' ->
+ mapTc tcCoreExpr rhss `thenTc` \ rhss' ->
+ tcCoreExpr body `thenTc` \ body' ->
+ returnTc (Let (Rec (bndrs' `zip` rhss')) body')
+ where
+ (bndrs, rhss) = unzip pairs
+
tcCoreExpr (UfNote note expr)
= tcCoreExpr expr `thenTc` \ expr' ->
case note of