{-# LANGUAGE UndecidableInstances #-}
{-# LANGUAGE FlexibleInstances #-}
module Control.Monad.Time.DefaultInstance (
module Control.Monad.Time.DefaultInstance,
module Control.Monad.Time) where
import Control.Monad.Time
import Control.Monad.Trans (liftIO)
import Data.Time (getCurrentTime)
import Control.Concurrent (threadDelay)
instance {-# OVERLAPPING #-}
MonadTime IO where
getCurrentTime :: IO UTCTime
getCurrentTime = IO UTCTime -> IO UTCTime
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO IO UTCTime
Data.Time.getCurrentTime
threadDelay :: Int -> IO ()
threadDelay Int
delay = IO () -> IO ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> IO ()) -> IO () -> IO ()
forall a b. (a -> b) -> a -> b
$ Int -> IO ()
Control.Concurrent.threadDelay Int
delay