module Effectful.Concurrent.QSemN
(
Concurrent
, runConcurrent
, QSemN
, newQSemN
, waitQSemN
, signalQSemN
) where
import Control.Concurrent.QSemN (QSemN)
import Control.Concurrent.QSemN qualified as Q
import Effectful
import Effectful.Concurrent.Effect
import Effectful.Dispatch.Static
newQSemN :: Concurrent :> es => Int -> Eff es QSemN
newQSemN :: forall (es :: [Effect]). (Concurrent :> es) => Int -> Eff es QSemN
newQSemN = IO QSemN -> Eff es QSemN
forall a (es :: [Effect]). IO a -> Eff es a
unsafeEff_ (IO QSemN -> Eff es QSemN)
-> (Int -> IO QSemN) -> Int -> Eff es QSemN
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Int -> IO QSemN
Q.newQSemN
waitQSemN :: Concurrent :> es => QSemN -> Int -> Eff es ()
waitQSemN :: forall (es :: [Effect]).
(Concurrent :> es) =>
QSemN -> Int -> Eff es ()
waitQSemN QSemN
x = IO () -> Eff es ()
forall a (es :: [Effect]). IO a -> Eff es a
unsafeEff_ (IO () -> Eff es ()) -> (Int -> IO ()) -> Int -> Eff es ()
forall b c a. (b -> c) -> (a -> b) -> a -> c
. QSemN -> Int -> IO ()
Q.waitQSemN QSemN
x
signalQSemN :: Concurrent :> es => QSemN -> Int -> Eff es ()
signalQSemN :: forall (es :: [Effect]).
(Concurrent :> es) =>
QSemN -> Int -> Eff es ()
signalQSemN QSemN
x = IO () -> Eff es ()
forall a (es :: [Effect]). IO a -> Eff es a
unsafeEff_ (IO () -> Eff es ()) -> (Int -> IO ()) -> Int -> Eff es ()
forall b c a. (b -> c) -> (a -> b) -> a -> c
. QSemN -> Int -> IO ()
Q.signalQSemN QSemN
x