module Effectful.Concurrent.QSem
(
Concurrent
, runConcurrent
, QSem
, newQSem
, waitQSem
, signalQSem
) where
import Control.Concurrent.QSem (QSem)
import Control.Concurrent.QSem qualified as Q
import Effectful
import Effectful.Concurrent.Effect
import Effectful.Dispatch.Static
newQSem :: Concurrent :> es => Int -> Eff es QSem
newQSem :: forall (es :: [Effect]). (Concurrent :> es) => Int -> Eff es QSem
newQSem = IO QSem -> Eff es QSem
forall a (es :: [Effect]). IO a -> Eff es a
unsafeEff_ (IO QSem -> Eff es QSem) -> (Int -> IO QSem) -> Int -> Eff es QSem
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Int -> IO QSem
Q.newQSem
waitQSem :: Concurrent :> es => QSem -> Eff es ()
waitQSem :: forall (es :: [Effect]). (Concurrent :> es) => QSem -> Eff es ()
waitQSem = IO () -> Eff es ()
forall a (es :: [Effect]). IO a -> Eff es a
unsafeEff_ (IO () -> Eff es ()) -> (QSem -> IO ()) -> QSem -> Eff es ()
forall b c a. (b -> c) -> (a -> b) -> a -> c
. QSem -> IO ()
Q.waitQSem
signalQSem :: Concurrent :> es => QSem -> Eff es ()
signalQSem :: forall (es :: [Effect]). (Concurrent :> es) => QSem -> Eff es ()
signalQSem = IO () -> Eff es ()
forall a (es :: [Effect]). IO a -> Eff es a
unsafeEff_ (IO () -> Eff es ()) -> (QSem -> IO ()) -> QSem -> Eff es ()
forall b c a. (b -> c) -> (a -> b) -> a -> c
. QSem -> IO ()
Q.signalQSem