Safe Haskell | None |
---|
Extra date functions.
- getYear :: FormatTime t => t -> Integer
- getMonth :: FormatTime t => t -> Integer
- getDay :: FormatTime t => t -> Integer
- relative :: UTCTime -> UTCTime -> Bool -> Text
- stopwatch :: MonadIO m => m a -> m (a, NominalDiffTime)
- bench :: MonadIO m => Integer -> m a -> m (a, NominalDiffTime)
Documentation
getYear :: FormatTime t => t -> IntegerSource
Get the current year.
getMonth :: FormatTime t => t -> IntegerSource
Get the current month.
getDay :: FormatTime t => t -> IntegerSource
Get the current day.
:: UTCTime | The later time span. |
-> UTCTime | The earlier time span. |
-> Bool | Display 'in/ago'? |
-> Text | Example: '3 seconds ago', 'in three days'. |
Display a time span as one time relative to another.
stopwatch :: MonadIO m => m a -> m (a, NominalDiffTime)Source
Run a stop-watch at the start and end of a computation.
bench :: MonadIO m => Integer -> m a -> m (a, NominalDiffTime)Source
Trivial benchmark for some monadic action.