hask-irc/Network/IRC/Util.hs

25 lines
511 B
Haskell
Raw Normal View History

{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE ScopedTypeVariables #-}
module Network.IRC.Util where
2014-05-22 01:08:36 +05:30
--import qualified Data.Text.Format as TF
--import qualified Data.Text.Format.Params as TF
import ClassyPrelude
import Control.Concurrent.Lifted (Chan)
oneSec :: Int
oneSec = 1000000
type Latch = MVar ()
latchIt :: Latch -> IO ()
latchIt latch = putMVar latch ()
awaitLatch :: Latch -> IO ()
awaitLatch latch = void $ takeMVar latch
type Channel a = (Chan a, Latch)