Skip to content

Commit

Permalink
MonadTime: export NominalDiffTime, diffUTCTime and addUTCTime
Browse files Browse the repository at this point in the history
We export 'DiffTime' and its action on 'Time' through 'addTime'.  We
also export 'UTCTime', but not 'NominalDiffTime' and its action on it.
This patch fixes this discrepency.
  • Loading branch information
coot committed Nov 24, 2020
1 parent 8fa98d3 commit 9832301
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
10 changes: 9 additions & 1 deletion io-sim-classes/src/Control/Monad/Class/MonadTime.hs
Expand Up @@ -2,15 +2,23 @@
module Control.Monad.Class.MonadTime (
MonadTime(..)
, MonadMonotonicTime(..)

-- * 'DiffTime' and its action on 'Time'
, Time(..)
, diffTime
, addTime
, DiffTime

-- * 'NominalTime' and its action on 'UTCTime'
, UTCTime
, diffUTCTime
, addUTCTime
, NominalDiffTime
) where

import Control.Monad.Reader
import Data.Time.Clock (DiffTime, UTCTime)
import Data.Time.Clock (DiffTime, NominalDiffTime, UTCTime,
addUTCTime, diffUTCTime)
import qualified Data.Time.Clock as Time
import Data.Word (Word64)

Expand Down
3 changes: 1 addition & 2 deletions io-sim/src/Control/Monad/IOSim/Internal.hs
Expand Up @@ -49,8 +49,7 @@ import Data.OrdPSQ (OrdPSQ)
import qualified Data.OrdPSQ as PSQ
import Data.Set (Set)
import qualified Data.Set as Set
import Data.Time (NominalDiffTime, UTCTime (..), addUTCTime,
diffUTCTime, fromGregorian)
import Data.Time (UTCTime (..), fromGregorian)
import Data.Typeable (Typeable)

import Control.Applicative (Alternative (..))
Expand Down
2 changes: 1 addition & 1 deletion io-sim/test/Test/IOSim.hs
Expand Up @@ -14,7 +14,7 @@ import Data.Fixed (Fixed (..), Micro)
import Data.Graph
import Data.Function (on)
import Data.List (sortBy)
import Data.Time.Clock (DiffTime, picosecondsToDiffTime)
import Data.Time.Clock (picosecondsToDiffTime)

import Control.Exception (ArithException (..))
import Control.Monad
Expand Down

0 comments on commit 9832301

Please sign in to comment.