\begin{code}
module SimplUtils (
- simplBinder, simplBinders, simplRecIds, simplLetId,
+ simplBinder, simplBinders, simplRecIds, simplLetId, simplLamBinder,
tryRhsTyLam, tryEtaExpansion,
mkCase,
findDefault
)
import Subst ( InScopeSet, mkSubst, substExpr )
-import qualified Subst ( simplBndrs, simplBndr, simplLetId )
+import qualified Subst ( simplBndrs, simplBndr, simplLetId, simplLamBndr )
import Id ( idType, idName,
idUnfolding, idNewStrictness,
mkLocalId, idInfo
)
-import IdInfo ( StrictnessInfo(..) )
import Maybes ( maybeToBool, catMaybes )
import Name ( setNameUnique )
import NewDemand ( isStrictDmd, isBotRes, splitStrictSig )
setSubst subst' (thing_inside bndr')
+simplLamBinder :: InBinder -> (OutBinder -> SimplM a) -> SimplM a
+simplLamBinder bndr thing_inside
+ = getSubst `thenSmpl` \ subst ->
+ let
+ (subst', bndr') = Subst.simplLamBndr subst bndr
+ in
+ seqBndr bndr' `seq`
+ setSubst subst' (thing_inside bndr')
+
+
simplRecIds :: [InBinder] -> ([OutBinder] -> SimplM a) -> SimplM a
simplRecIds ids thing_inside
= getSubst `thenSmpl` \ subst ->