module UnliftIO.Chan
( Chan
, newChan
, writeChan
, readChan
, dupChan
, getChanContents
, writeList2Chan
) where
import Control.Monad.IO.Unlift
import Control.Concurrent.Chan (Chan)
import qualified Control.Concurrent.Chan as C
newChan :: MonadIO m => m (Chan a)
newChan = liftIO C.newChan
writeChan :: MonadIO m => Chan a -> a -> m ()
writeChan c = liftIO . C.writeChan c
readChan :: MonadIO m => Chan a -> m a
readChan = liftIO . C.readChan
dupChan :: MonadIO m => Chan a -> m (Chan a)
dupChan = liftIO . C.dupChan
getChanContents :: MonadIO m => Chan a -> m [a]
getChanContents = liftIO . C.getChanContents
writeList2Chan :: MonadIO m => Chan a -> [a] -> m ()
writeList2Chan c = liftIO . C.writeList2Chan c