-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Use a time unit class, but hold a concrete time type. -- -- Two common ways to represent and hold short time intervals seem to be: -- --
-- data Settings t = Settings
-- { x :: Int
-- , y :: Text
-- , z :: t
-- }
--
--
-- And any use of z would require to specify the TimeUnit t
-- => constraint. If you want to add more settings fields later
-- which are time durations, you'll need to add more type variables which
-- may break code which uses the Settings type.
--
--
-- data Settings t1 t2 t3 = Settings
-- { x :: Int
-- , y :: Text
-- , z :: t1
-- , u :: t2
-- , v :: t3
-- }
--
--
-- This package provides something between Int and
-- TimeUnit. A concrete type for specifying time durations, which
-- both hide the integers and avoid the type variables:
--
--
-- data Settings = Settings
-- { x :: Int
-- , y :: Text
-- , z :: TimeInterval
-- , u :: TimeInterval
-- , v :: TimeInterval
-- }
--
--
-- There is nothing magical here, this is simply a convenience package
-- for people who encounter this issue in their code.
--
-- Note that currently TimeInterval stores time as microseconds
-- internally. This may be a problem if you plan to work with smaller
-- intervals (nanoseconds, picoseconds, etc.). If you have such needs,
-- please contact the maintainer to discuss a solution.
module Data.Time.Interval
-- | A time duration.
data TimeInterval
-- | Convert a time value expressed in a some time unit into a
-- TimeInterval.
fromTimeUnit :: TimeUnit t => t -> TimeInterval
-- | Convert a TimeInterval to a TimeUnit instance.
toTimeUnit :: TimeUnit t => TimeInterval -> t
-- | Specialized toTimeUnit for converting to Microsecond
-- units.
toMicroUnit :: TimeInterval -> Microsecond
-- | Deprecated alias of fromTimeUnit.
-- | Deprecated: Use fromTimeUnit instead
time :: TimeUnit t => t -> TimeInterval
-- | Express a TimeInterval in microseconds.
microseconds :: TimeInterval -> Integer
instance GHC.Show.Show Data.Time.Interval.TimeInterval
instance GHC.Real.Real Data.Time.Interval.TimeInterval
instance GHC.Num.Num Data.Time.Interval.TimeInterval
instance GHC.Classes.Ord Data.Time.Interval.TimeInterval
instance GHC.Real.Integral Data.Time.Interval.TimeInterval
instance GHC.Classes.Eq Data.Time.Interval.TimeInterval
instance GHC.Enum.Enum Data.Time.Interval.TimeInterval