- | Just (tickInfo, _exp) <- isTickedExp' exp = do
- let fvs = exprFreeVars $ deAnnotate' exp
- let ty = exprType $ deAnnotate' exp
- id <- newId ty
- -- Todo: is emptyVarSet correct on the next line?
- let letExp = AnnLet (AnnNonRec id (fvs, exp)) (emptyVarSet, AnnVar id)
- schemeE d s p letExp
+ | Just (tickInfo,rhs) <- isTickedExp' exp
+ = if isUnLiftedType ty
+ then schemeE d s p (snd rhs)
+ else do
+ id <- newId ty
+ -- Todo: is emptyVarSet correct on the next line?
+ let letExp = AnnLet (AnnNonRec id (fvs, exp)) (emptyVarSet, AnnVar id)
+ schemeE d s p letExp
+ where exp' = deAnnotate' exp
+ fvs = exprFreeVars exp'
+ ty = exprType exp'