-
Notifications
You must be signed in to change notification settings - Fork 23
Expand file tree
/
Copy pathUtil.hs
More file actions
24 lines (15 loc) · 729 Bytes
/
Util.hs
File metadata and controls
24 lines (15 loc) · 729 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
module Util where
import Control.Concurrent
import Control.Monad.IO.Class
import Data.Aeson
import Data.Hashable
-- A few minor bits and pieces shared across modules
waitNSec :: MonadIO m => Int -> m ()
waitNSec sec = liftIO . threadDelay $ sec * 1000 * 1000
newtype IPAddress = IPAddress { fromIPAddress :: String }
deriving (Eq, Ord, Show, ToJSON, FromJSON, Hashable)
newtype BridgeUserID = BridgeUserID { fromBridgeUserID :: String }
deriving (Eq, Ord, Show, FromJSON, ToJSON, Hashable)
newtype CookieUserID = CookieUserID { fromCookieUserID :: String }
deriving (Eq, Ord, Show, FromJSON, ToJSON, Hashable)