-- | Lifted "Control.Concurrent.QSemN".
module Effectful.Concurrent.QSemN
  ( -- * Effect
    Concurrent

    -- ** Handlers
  , runConcurrent

    -- * QSemN
  , QSemN
  , newQSemN
  , waitQSemN
  , signalQSemN
  ) where

import Control.Concurrent.QSemN (QSemN)
import qualified Control.Concurrent.QSemN as Q

import Effectful
import Effectful.Concurrent.Effect
import Effectful.Dispatch.Static

-- | Lifted 'Q.newQSemN'.
newQSemN :: Concurrent :> es => Int -> Eff es QSemN
newQSemN :: forall (es :: [Effect]). (Concurrent :> es) => Int -> Eff es QSemN
newQSemN = forall a (es :: [Effect]). IO a -> Eff es a
unsafeEff_ forall b c a. (b -> c) -> (a -> b) -> a -> c
. Int -> IO QSemN
Q.newQSemN

-- | Lifted 'Q.waitQSemN'.
waitQSemN :: Concurrent :> es => QSemN -> Int -> Eff es ()
waitQSemN :: forall (es :: [Effect]).
(Concurrent :> es) =>
QSemN -> Int -> Eff es ()
waitQSemN QSemN
x = forall a (es :: [Effect]). IO a -> Eff es a
unsafeEff_ forall b c a. (b -> c) -> (a -> b) -> a -> c
. QSemN -> Int -> IO ()
Q.waitQSemN QSemN
x

-- | Lifted 'Q.signalQSemN'.
signalQSemN :: Concurrent :> es => QSemN -> Int -> Eff es ()
signalQSemN :: forall (es :: [Effect]).
(Concurrent :> es) =>
QSemN -> Int -> Eff es ()
signalQSemN QSemN
x = forall a (es :: [Effect]). IO a -> Eff es a
unsafeEff_ forall b c a. (b -> c) -> (a -> b) -> a -> c
. QSemN -> Int -> IO ()
Q.signalQSemN QSemN
x