recoverTc, recoverQuietlyTc,
NF_TcM(..),
- thenNF_Tc, returnNF_Tc, listNF_Tc, mapNF_Tc,
+ thenNF_Tc, thenLazilyNF_Tc, returnNF_Tc, listNF_Tc, mapNF_Tc,
fixNF_Tc, noFailTc,
Baby_TcM(..), Baby_TcResult{-abstract-},
import Unique
import Util
-infixr 9 `thenTc`, `thenTc_`, `thenNF_Tc`
+infixr 9 `thenTc`, `thenTc_`, `thenNF_Tc`, `thenLazilyNF_Tc`
\end{code}
%************************************************************************
#ifdef __GLASGOW_HASKELL__
{-# INLINE thenNF_Tc #-}
+{-# INLINE thenLazilyNF_Tc #-}
{-# INLINE returnNF_Tc #-}
#endif
-thenNF_Tc :: NF_TcM a -> (a -> InTcM b) -> InTcM b
+thenNF_Tc, thenLazilyNF_Tc :: NF_TcM a -> (a -> InTcM b) -> InTcM b
+-- ...Lazily... is purely a performance thing (WDP 95/09)
\end{code}
In particular, @thenNF_Tc@ has all of these types:
-> cont result sw_chkr dtys subst2 s2 errs2 src_loc
}
+thenLazilyNF_Tc expr cont sw_chkr dtys subst us errs src_loc
+ = let
+ (s1, s2) = splitUniqSupply us
+ in
+ case (expr sw_chkr dtys subst s1 errs src_loc) of {
+ (result, subst2, errs2)
+ -> cont result sw_chkr dtys subst2 s2 errs2 src_loc
+ }
+
returnNF_Tc :: a -> NF_TcM a
returnNF_Tc result sw_chkr dtys subst us errs src_loc
= (result, subst, errs)