@@ -11,6 +11,7 @@ module Streamly.Internal.Data.SVar.Type
1111 -- * Parent child communication
1212 ThreadAbort (..)
1313 , ChildEvent (..)
14+ , RunInIO(..)
1415 , AheadHeapEntry (..)
1516
1617 -- * SVar
@@ -55,6 +56,9 @@ where
5556import Control.Concurrent (ThreadId)
5657import Control.Concurrent.MVar (MVar)
5758import Control.Exception (SomeException(..), Exception)
59+#ifndef USE_UNLIFTIO
60+import Control.Monad.Trans.Control (MonadBaseControl(StM))
61+#endif
5862import Data.Heap (Heap, Entry(..))
5963import Data.Int (Int64)
6064import Data.IORef (IORef)
@@ -62,7 +66,6 @@ import Data.Kind (Type)
6266import Data.Set (Set)
6367
6468import Streamly.Internal.Data.Time.Units (AbsTime, NanoSecond64(..))
65−import Streamly.Internal.Control.Concurrent (RunInIO)
6669
6770newtype Count = Count Int64
6871 deriving ( Eq
@@ -89,6 +92,12 @@ data ChildEvent a =
8992 ChildYield a
9093 | ChildStop ThreadId (Maybe SomeException)
9194
95+#ifdef USE_UNLIFTIO
96+newtype RunInIO m = RunInIO { runInIO :: forall b. m b -> IO b }
97+#else
98+newtype RunInIO m = RunInIO { runInIO :: forall b. m b -> IO (StM m b) }
99+#endif
100+
92101-- | Sorting out-of-turn outputs in a heap for Ahead style streams
93102data AheadHeapEntry (t :: (Type -> Type) -> Type -> Type) m a =
94103 AheadEntryNull