#ifdef __GLASGOW_HASKELL__
{-# INLINE andRn4 #-}
{-# INLINE thenRn4 #-}
+{-# INLINE thenLazilyRn4 #-}
{-# INLINE thenRn4_ #-}
{-# INLINE returnRn4 #-}
#endif
initRn4 sw_chkr gnfs renamer init_us
= renamer sw_chkr gnfs emptyFM emptyBag init_us mkUnknownSrcLoc
-thenRn4 :: Rn4M a -> (a -> Rn4M b) -> Rn4M b
+thenRn4, thenLazilyRn4
+ :: Rn4M a -> (a -> Rn4M b) -> Rn4M b
thenRn4_ :: Rn4M a -> Rn4M b -> Rn4M b
andRn4 :: (a -> a -> a) -> Rn4M a -> Rn4M a -> Rn4M a
case (cont res1 sw_chkr gnfs ss errs1 s2 locn) of { (res2, errs2) ->
(res2, errs2) }}}
+thenLazilyRn4 expr cont sw_chkr gnfs ss errs uniqs locn
+ = let
+ (s1, s2) = splitUniqSupply uniqs
+ (res1, errs1) = expr sw_chkr gnfs ss errs s1 locn
+ (res2, errs2) = cont res1 sw_chkr gnfs ss errs1 s2 locn
+ in
+ (res2, errs2)
+
thenRn4_ expr cont sw_chkr gnfs ss errs uniqs locn
= case (splitUniqSupply uniqs) of { (s1, s2) ->
case (expr sw_chkr gnfs ss errs s1 locn) of { (_, errs1) ->
\begin{code}
lookupValue v {-Rn4-} sw_chkr gnfs ss errs_so_far us locn
- = (lookup_val v `thenRn4` \ name ->
+ = (lookup_val v `thenLazilyRn4` \ name ->
if invisibleName name
then failButContinueRn4 (unboundName v) (unknownNameErr "value" v mkUnknownSrcLoc)
else returnRn4 name
-- The global name funs handle Prel things
lookupTyCon tc {-Rn4-} sw_chkr gnfs ss errs_so_far us locn
- = (lookup_tycon tc `thenRn4` \ name ->
+ = (lookup_tycon tc `thenLazilyRn4` \ name ->
if invisibleName name
then failButContinueRn4 (unboundName tc) (unknownNameErr "type constructor" tc mkUnknownSrcLoc)
else returnRn4 name