Skip to content

Commit 45050fe

Browse files
committed
io-sim-classes: derive Generic instance of Time
1 parent 8383755 commit 45050fe

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

io-sim-classes/src/Control/Monad/Class/MonadTime.hs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
{-# LANGUAGE DeriveGeneric #-}
12

23
module Control.Monad.Class.MonadTime (
34
MonadTime(..)
@@ -21,6 +22,7 @@ import Data.Time.Clock (DiffTime, NominalDiffTime, UTCTime,
2122
addUTCTime, diffUTCTime)
2223
import qualified Data.Time.Clock as Time
2324
import Data.Word (Word64)
25+
import GHC.Generics (Generic (..))
2426

2527
-- | A point in time in a monotonic clock.
2628
--
@@ -29,7 +31,7 @@ import Data.Word (Word64)
2931
-- program runs. It is represented as the 'DiffTime' from this arbitrary epoch.
3032
--
3133
newtype Time = Time DiffTime
32-
deriving (Eq, Ord, Show)
34+
deriving (Eq, Ord, Show, Generic)
3335

3436
-- | The time duration between two points in time (positive or negative).
3537
diffTime :: Time -> Time -> DiffTime

0 commit comments

Comments
 (0)