-- Generate a binder for the expression
id <- Trans.lift $ mkBinderFor val "castval"
-- Extract the expression
- change $ Let (Rec [(id, val)]) (Cast (Var id) ty)
+ change $ Let (NonRec id val) (Cast (Var id) ty)
else
return expr
-- Leave all other expressions unchanged
if repr
then do
id <- Trans.lift $ mkBinderFor scrut "scrut"
- change $ Let (Rec [(id, scrut)]) (Case (Var id) b ty alts)
+ change $ Let (NonRec id scrut) (Case (Var id) b ty alts)
else
return expr
-- Leave all other expressions unchanged
if repr && not local_var
then do -- Extract representable arguments
id <- Trans.lift $ mkBinderFor arg "arg"
- change $ Let (Rec [(id, arg)]) (App f (Var id))
+ change $ Let (NonRec id arg) (App f (Var id))
else -- Leave non-representable arguments unchanged
return expr
-- Leave all other expressions unchanged