@@ -11,6 +11,7 @@ module Streamly.Internal.Data.SVar.Type
11 -- * Parent child communication
11 -- * Parent child communication
12 ThreadAbort (..)
12 ThreadAbort (..)
13 , ChildEvent (..)
13 , ChildEvent (..)
14 , AheadHeapEntry (..)
15 , AheadHeapEntry (..)
@@ -55,6 +56,9 @@ where
55import Control.Concurrent (ThreadId)
56import Control.Concurrent (ThreadId)
56import Control.Concurrent.MVar (MVar)
57import Control.Concurrent.MVar (MVar)
57import Control.Exception (SomeException(..), Exception)
58import Control.Exception (SomeException(..), Exception)
60+import Control.Monad.Trans.Control (MonadBaseControl(StM))
58import Data.Heap (Heap, Entry(..))
62import Data.Heap (Heap, Entry(..))
59import Data.Int (Int64)
63import Data.Int (Int64)
60import Data.IORef (IORef)
64import Data.IORef (IORef)
@@ -62,7 +66,6 @@ import Data.Kind (Type)
62import Data.Set (Set)
66import Data.Set (Set)
64import Streamly.Internal.Data.Time.Units (AbsTime, NanoSecond64(..))
68import Streamly.Internal.Data.Time.Units (AbsTime, NanoSecond64(..))
65−import Streamly.Internal.Control.Concurrent (RunInIO)
67newtype Count = Count Int64
70newtype Count = Count Int64
68 deriving ( Eq
71 deriving ( Eq
@@ -89,6 +92,12 @@ data ChildEvent a =
89 ChildYield a
92 ChildYield a
90 | ChildStop ThreadId (Maybe SomeException)
93 | ChildStop ThreadId (Maybe SomeException)
96+newtype RunInIO m = RunInIO { runInIO :: forall b. m b -> IO b }
98+newtype RunInIO m = RunInIO { runInIO :: forall b. m b -> IO (StM m b) }
92-- | Sorting out-of-turn outputs in a heap for Ahead style streams
101-- | Sorting out-of-turn outputs in a heap for Ahead style streams
93data AheadHeapEntry (t :: (Type -> Type) -> Type -> Type) m a =
102data AheadHeapEntry (t :: (Type -> Type) -> Type -> Type) m a =
94 AheadEntryNull
103 AheadEntryNull