thyme-0.3.5.5: A faster time library

Safe Haskell | None
Language | Haskell2010

Data.Thyme.Time.Core

Description

This module provides just the compatibility wrappers for the things that `thyme` does differently from `time`. No `RealFrac` instances for `DiffTime` nor `NominalDiffTime`, nor other riffraff.

Synopsis

- module Data.Thyme
- class Thyme a b | b -> a where
  - thyme :: Iso' a b
- toThyme :: Thyme a b => a -> b
- fromThyme :: Thyme a b => b -> a
- addDays :: Days -> Day -> Day
- diffDays :: Day -> Day -> Days
- toGregorian :: Day -> (Year, Month, DayOfMonth)
- fromGregorian :: Year -> Month -> DayOfMonth -> Day
- fromGregorianValid :: Year -> Month -> DayOfMonth -> Maybe Day
- addGregorianMonthsClip :: Months -> Day -> Day
- addGregorianMonthsRollover :: Months -> Day -> Day
- addGregorianYearsClip :: Years -> Day -> Day
- addGregorianYearsRollover :: Years -> Day -> Day
- dayOfYearToMonthAndDay :: Bool -> DayOfYear -> (Month, DayOfMonth)
- monthAndDayToDayOfYear :: Bool -> Month -> DayOfMonth -> DayOfYear
- monthAndDayToDayOfYearValid :: Bool -> Month -> DayOfMonth -> Maybe DayOfYear
- toOrdinalDate :: Day -> (Year, DayOfYear)
- fromOrdinalDate :: Year -> DayOfYear -> Day
- fromOrdinalDateValid :: Year -> DayOfYear -> Maybe Day
- sundayStartWeek :: Day -> (Year, WeekOfYear, DayOfWeek)
- fromSundayStartWeek :: Year -> WeekOfYear -> DayOfWeek -> Day
- fromSundayStartWeekValid :: Year -> WeekOfYear -> DayOfWeek -> Maybe Day
- mondayStartWeek :: Day -> (Year, WeekOfYear, DayOfWeek)
- fromMondayStartWeek :: Year -> WeekOfYear -> DayOfWeek -> Day
- fromMondayStartWeekValid :: Year -> WeekOfYear -> DayOfWeek -> Maybe Day
- toWeekDate :: Day -> (Year, WeekOfYear, DayOfWeek)
- fromWeekDate :: Year -> WeekOfYear -> DayOfWeek -> Day
- fromWeekDateValid :: Year -> WeekOfYear -> DayOfWeek -> Maybe Day
- getModJulianDate :: UniversalTime -> Rational
- mkModJulianDate :: Rational -> UniversalTime
- secondsToDiffTime :: Int64 -> DiffTime
- picosecondsToDiffTime :: Int64 -> DiffTime
- mkUTCTime :: Day -> DiffTime -> UTCTime
- unUTCTime :: UTCTime -> UTCView
- addUTCTime :: NominalDiffTime -> UTCTime -> UTCTime
- diffUTCTime :: UTCTime -> UTCTime -> NominalDiffTime
- toMicroseconds :: TimeDiff t => t -> Int64
- fromMicroseconds :: TimeDiff t => Int64 -> t
- posixSecondsToUTCTime :: POSIXTime -> UTCTime
- utcTimeToPOSIXSeconds :: UTCTime -> POSIXTime
- addAbsoluteTime :: DiffTime -> AbsoluteTime -> AbsoluteTime
- diffAbsoluteTime :: AbsoluteTime -> AbsoluteTime -> DiffTime
- utcToTAITime :: LeapSecondTable -> UTCTime -> AbsoluteTime
- taiToUTCTime :: LeapSecondTable -> AbsoluteTime -> UTCTime
- utcToLocalTimeOfDay :: TimeZone -> TimeOfDay -> (Days, TimeOfDay)
- localToUTCTimeOfDay :: TimeZone -> TimeOfDay -> (Days, TimeOfDay)
- timeToTimeOfDay :: DiffTime -> TimeOfDay
- timeOfDayToTime :: TimeOfDay -> DiffTime
- dayFractionToTimeOfDay :: Rational -> TimeOfDay
- timeOfDayToDayFraction :: TimeOfDay -> Rational
- utcToLocalTime :: TimeZone -> UTCTime -> LocalTime
- localTimeToUTC :: TimeZone -> LocalTime -> UTCTime
- ut1ToLocalTime :: Rational -> UniversalTime -> LocalTime
- localTimeToUT1 :: Rational -> LocalTime -> UniversalTime
- utcToZonedTime :: TimeZone -> UTCTime -> ZonedTime
- zonedTimeToUTC :: ZonedTime -> UTCTime

# Documentation

module Data.Thyme

class Thyme a b | b -> a where Source #

Methods

thyme :: Iso' a b Source #

Instances

Thyme UTCTime UTCTime Source # |
Instance details Defined in Data.Thyme.Time.Core Methods thyme :: Iso' UTCTime0 UTCTime Source #
Thyme UTCTime UTCView Source # |
Instance details Defined in Data.Thyme.Time.Core Methods thyme :: Iso' UTCTime UTCView Source #
Thyme ZonedTime ZonedTime Source # |
Instance details Defined in Data.Thyme.Time.Core Methods thyme :: Iso' ZonedTime0 ZonedTime Source #
Thyme LocalTime LocalTime Source # |
Instance details Defined in Data.Thyme.Time.Core Methods thyme :: Iso' LocalTime0 LocalTime Source #
Thyme TimeOfDay TimeOfDay Source # |
Instance details Defined in Data.Thyme.Time.Core Methods thyme :: Iso' TimeOfDay0 TimeOfDay Source #
Thyme TimeZone TimeZone Source # |
Instance details Defined in Data.Thyme.Time.Core Methods thyme :: Iso' TimeZone0 TimeZone Source #
Thyme UniversalTime UniversalTime Source # |
Instance details Defined in Data.Thyme.Time.Core Methods thyme :: Iso' UniversalTime0 UniversalTime Source #
Thyme NominalDiffTime NominalDiffTime Source # |
Instance details Defined in Data.Thyme.Time.Core Methods thyme :: Iso' NominalDiffTime0 NominalDiffTime Source #
Thyme AbsoluteTime AbsoluteTime Source # |
Instance details Defined in Data.Thyme.Time.Core Methods thyme :: Iso' AbsoluteTime0 AbsoluteTime Source #
Thyme DiffTime DiffTime Source # |
Instance details Defined in Data.Thyme.Time.Core Methods thyme :: Iso' DiffTime0 DiffTime Source #
Thyme Day Day Source # |
Instance details Defined in Data.Thyme.Time.Core Methods thyme :: Iso' Day0 Day Source #

toThyme :: Thyme a b => a -> b Source #

fromThyme :: Thyme a b => b -> a Source #

addDays :: Days -> Day -> Day Source #

diffDays :: Day -> Day -> Days Source #

toGregorian :: Day -> (Year, Month, DayOfMonth) Source #

fromGregorian :: Year -> Month -> DayOfMonth -> Day Source #

fromGregorianValid :: Year -> Month -> DayOfMonth -> Maybe Day Source #

addGregorianMonthsClip :: Months -> Day -> Day Source #

addGregorianMonthsRollover :: Months -> Day -> Day Source #

addGregorianYearsClip :: Years -> Day -> Day Source #

addGregorianYearsRollover :: Years -> Day -> Day Source #

dayOfYearToMonthAndDay :: Bool -> DayOfYear -> (Month, DayOfMonth) Source #

monthAndDayToDayOfYear :: Bool -> Month -> DayOfMonth -> DayOfYear Source #

monthAndDayToDayOfYearValid :: Bool -> Month -> DayOfMonth -> Maybe DayOfYear Source #

toOrdinalDate :: Day -> (Year, DayOfYear) Source #

fromOrdinalDate :: Year -> DayOfYear -> Day Source #

fromOrdinalDateValid :: Year -> DayOfYear -> Maybe Day Source #

sundayStartWeek :: Day -> (Year, WeekOfYear, DayOfWeek) Source #

fromSundayStartWeek :: Year -> WeekOfYear -> DayOfWeek -> Day Source #

fromSundayStartWeekValid :: Year -> WeekOfYear -> DayOfWeek -> Maybe Day Source #

mondayStartWeek :: Day -> (Year, WeekOfYear, DayOfWeek) Source #

fromMondayStartWeek :: Year -> WeekOfYear -> DayOfWeek -> Day Source #

fromMondayStartWeekValid :: Year -> WeekOfYear -> DayOfWeek -> Maybe Day Source #

toWeekDate :: Day -> (Year, WeekOfYear, DayOfWeek) Source #

fromWeekDate :: Year -> WeekOfYear -> DayOfWeek -> Day Source #

fromWeekDateValid :: Year -> WeekOfYear -> DayOfWeek -> Maybe Day Source #

getModJulianDate :: UniversalTime -> Rational Source #

mkModJulianDate :: Rational -> UniversalTime Source #

Replacement for `ModJulianDate`.

secondsToDiffTime :: Int64 -> DiffTime Source #

picosecondsToDiffTime :: Int64 -> DiffTime Source #

mkUTCTime :: Day -> DiffTime -> UTCTime Source #

unUTCTime :: UTCTime -> UTCView Source #

addUTCTime :: NominalDiffTime -> UTCTime -> UTCTime Source #

diffUTCTime :: UTCTime -> UTCTime -> NominalDiffTime Source #

toMicroseconds :: TimeDiff t => t -> Int64 Source #

fromMicroseconds :: TimeDiff t => Int64 -> t Source #

posixSecondsToUTCTime :: POSIXTime -> UTCTime Source #

utcTimeToPOSIXSeconds :: UTCTime -> POSIXTime Source #

addAbsoluteTime :: DiffTime -> AbsoluteTime -> AbsoluteTime Source #

diffAbsoluteTime :: AbsoluteTime -> AbsoluteTime -> DiffTime Source #

utcToTAITime :: LeapSecondTable -> UTCTime -> AbsoluteTime Source #

taiToUTCTime :: LeapSecondTable -> AbsoluteTime -> UTCTime Source #

utcToLocalTimeOfDay :: TimeZone -> TimeOfDay -> (Days, TimeOfDay) Source #

localToUTCTimeOfDay :: TimeZone -> TimeOfDay -> (Days, TimeOfDay) Source #

timeToTimeOfDay :: DiffTime -> TimeOfDay Source #

timeOfDayToTime :: TimeOfDay -> DiffTime Source #

dayFractionToTimeOfDay :: Rational -> TimeOfDay Source #

timeOfDayToDayFraction :: TimeOfDay -> Rational Source #

utcToLocalTime :: TimeZone -> UTCTime -> LocalTime Source #

localTimeToUTC :: TimeZone -> LocalTime -> UTCTime Source #

ut1ToLocalTime :: Rational -> UniversalTime -> LocalTime Source #

localTimeToUT1 :: Rational -> LocalTime -> UniversalTime Source #

utcToZonedTime :: TimeZone -> UTCTime -> ZonedTime Source #

zonedTimeToUTC :: ZonedTime -> UTCTime Source #