@@ -83,8 +83,11 @@ runAsynclyLogged lref m = run Nothing m
8383 where
8484
8585 stop = return ()
86+
8687 {-# INLINE yield #-}
87− yield _ c r = maybe stop (\x -> (run c x)) r
88+ yield _ _ Nothing = stop
89+ yield _ c (Just x) = run c x
90+
8891 run ct mx = (runAsyncT mx) ct stop yield
8992
9093runAsyncly :: MonadAsync m => AsynclyT m a -> m ()
@@ -99,9 +102,10 @@ toList m = run Nothing m
99102 where
100103
101104 stop = return []
102− done a = return [a]
105+
103106 {-# INLINE yield #-}
104− yield a c r = maybe (done a) (\x -> liftM (a :) (run c x)) r
107+ yield a _ Nothing = return [a]
108+ yield a c (Just x) = liftM (a :) (run c x)
105109
106110 {-# INLINE run #-}
107111 run ctx mx = (runAsyncT mx) ctx stop yield