-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | A high-performance time library -- -- Chronos is a performance-oriented time library for Haskell, with a -- straightforward API. The main differences between this and the -- time library are: -- -- @package chronos @version 1.1.2 -- | Chronos is a performance-oriented time library for Haskell, with a -- straightforward API. The main differences between this and the -- time library are: -- -- module Chronos -- | Get the current time from the system clock. now :: IO Time -- | Gets the current Day. This does not take the user's time zone -- into account. today :: IO Day -- | Gets the Day of tomorrow. tomorrow :: IO Day -- | Gets the Day of yesterday. yesterday :: IO Day -- | Get the current DayOfWeek from the system clock. todayDayOfWeek :: IO DayOfWeek -- | Get the yesterday's DayOfWeek from the system clock. yesterdayDayOfWeek :: IO DayOfWeek -- | Get the tomorrow's DayOfWeek from the system clock. tomorrowDayOfWeek :: IO DayOfWeek -- | Convert from Time to DayOfWeek. timeToDayOfWeek :: Time -> DayOfWeek -- | The Unix epoch, that is 1970-01-01 00:00:00. epoch :: Time -- | Measures the time it takes to run an action and evaluate its result to -- WHNF. This measurement uses a monotonic clock instead of the standard -- system clock. stopwatch :: IO a -> IO (Timespan, a) -- | Measures the time it takes to run an action. The result is discarded. -- This measurement uses a monotonic clock instead of the standard system -- clock. stopwatch_ :: IO a -> IO Timespan -- | Construct a Datetime from year, month, day, hour, minute, -- second: -- --
--   >>> datetimeFromYmdhms 2014 2 26 17 58 52
--   Datetime {datetimeDate = Date {dateYear = Year {getYear = 2014}, dateMonth = Month {getMonth = 1}, dateDay = DayOfMonth {getDayOfMonth = 26}}, datetimeTime = TimeOfDay {timeOfDayHour = 17, timeOfDayMinute = 58, timeOfDayNanoseconds = 52000000000}}
--   
datetimeFromYmdhms :: Int -> Int -> Int -> Int -> Int -> Int -> Datetime -- | Construct a Time from year, month, day, hour, minute, second: -- --
--   >>> timeFromYmdhms 2014 2 26 17 58 52
--   Time {getTime = 1393437532000000000}
--   
timeFromYmdhms :: Int -> Int -> Int -> Int -> Int -> Int -> Time -- | Convert Time to Datetime. -- --
--   \(t :: Time) -> (datetimeToTime (timeToDatetime t)) == t
--   
timeToDatetime :: Time -> Datetime -- | Convert Datetime to Time. -- --
--   \(d :: Datetime) -> timeToDatetime (datetimeToTime d) == d
--   
datetimeToTime :: Datetime -> Time -- | Convert Datetime to DayOfWeek datetimeToDayOfWeek :: Datetime -> DayOfWeek -- | Convert Time to OffsetDatetime by providing an -- Offset. timeToOffsetDatetime :: Offset -> Time -> OffsetDatetime -- | Convert OffsetDatetime to Time. offsetDatetimeToTime :: OffsetDatetime -> Time -- | Convert Time to Day. This function is lossy; -- consequently, it does not roundtrip with dayToTimeMidnight. timeToDayTruncate :: Time -> Day -- | Convert midnight of the given Day to Time. dayToTimeMidnight :: Day -> Time -- | Convert Day to a Date. -- --
--   \(d :: Day) -> dateToDay (dayToDate d) == d
--   
dayToDate :: Day -> Date -- | Convert a Date to a Day. -- --
--   \(d :: Date) -> dayToDate (dateToDay d) == d
--   
dateToDay :: Date -> Day -- | Convert a Day to an OrdinalDate. dayToOrdinalDate :: Day -> OrdinalDate -- | Convert an OrdinalDate to a Day. ordinalDateToDay :: OrdinalDate -> Day -- | Convert a MonthDate to a DayOfYear. monthDateToDayOfYear :: Bool -> MonthDate -> DayOfYear -- | Convert a DayOfYear to a MonthDate. dayOfYearToMonthDay :: Bool -> DayOfYear -> MonthDate -- | A Timespan representing a single second. second :: Timespan -- | A Timespan representing a single minute. minute :: Timespan -- | A Timespan representing a single hour. hour :: Timespan -- | A Timespan representing a single day. day :: Timespan -- | A Timespan representing a single week. week :: Timespan -- | Build a DayOfWeekMatch from seven (7) values. buildDayOfWeekMatch :: a -> a -> a -> a -> a -> a -> a -> DayOfWeekMatch a -- | Build a MonthMatch from twelve (12) values. buildMonthMatch :: a -> a -> a -> a -> a -> a -> a -> a -> a -> a -> a -> a -> MonthMatch a -- | Build an UnboxedMonthMatch from twelve (12) values. buildUnboxedMonthMatch :: Unbox a => a -> a -> a -> a -> a -> a -> a -> a -> a -> a -> a -> a -> UnboxedMonthMatch a -- | Match a DayOfWeek against a DayOfWeekMatch. caseDayOfWeek :: DayOfWeekMatch a -> DayOfWeek -> a -- | Match a Month against a MonthMatch. caseMonth :: MonthMatch a -> Month -> a -- | Match a Month against an UnboxedMonthMatch. caseUnboxedMonth :: Unbox a => UnboxedMonthMatch a -> Month -> a -- | The W3C DatetimeFormat. -- --
--   >>> encode_YmdHMS SubsecondPrecisionAuto w3c (timeToDatetime (timeFromYmdhms 2014 2 26 17 58 52))
--   "2014-02-26T17:58:52"
--   
-- --
--   \(s :: SubsecondPrecision) (dt :: Datetime) -> isJust (decode_YmdHMS w3c (encode_YmdHMS s w3c dt))
--   
w3c :: DatetimeFormat -- | A DatetimeFormat that separates the members of the Date -- by slashes. -- --
--   >>> encode_YmdHMS SubsecondPrecisionAuto slash (timeToDatetime (timeFromYmdhms 2014 2 26 17 58 52))
--   "2014/02/26 17:58:52"
--   
-- --
--   \(s :: SubsecondPrecision) (dt :: Datetime) -> isJust (decode_YmdHMS slash (encode_YmdHMS s slash dt))
--   
slash :: DatetimeFormat -- | A DatetimeFormat that separates the members of the Date -- by hyphens. -- --
--   >>> encode_YmdHMS SubsecondPrecisionAuto hyphen (timeToDatetime (timeFromYmdhms 2014 2 26 17 58 52))
--   "2014-02-26 17:58:52"
--   
-- --
--   \(s :: SubsecondPrecision) (dt :: Datetime) -> isJust (decode_YmdHMS hyphen (encode_YmdHMS s hyphen dt))
--   
hyphen :: DatetimeFormat -- | A DatetimeFormat with no separators, except for a T -- between the Date and Time. -- --
--   >>> encode_YmdHMS SubsecondPrecisionAuto compact (timeToDatetime (timeFromYmdhms 2014 2 26 17 58 52))
--   "20140226T175852"
--   
-- --
--   \(s :: SubsecondPrecision) (dt :: Datetime) -> isJust (decode_YmdHMS compact (encode_YmdHMS s compact dt))
--   
compact :: DatetimeFormat -- | Deconstruct a Time into its TimeParts. timeParts :: Offset -> Time -> TimeParts -- | The Month of January. january :: Month -- | The Month of February. february :: Month -- | The Month of March. march :: Month -- | The Month of April. april :: Month -- | The Month of May. may :: Month -- | The Month of June. june :: Month -- | The Month of July. july :: Month -- | The Month of August. august :: Month -- | The Month of September. september :: Month -- | The Month of October. october :: Month -- | The Month of November. november :: Month -- | The Month of December. december :: Month -- | The DayOfWeek Sunday. sunday :: DayOfWeek -- | The DayOfWeek Monday. monday :: DayOfWeek -- | The DayOfWeek Tuesday. tuesday :: DayOfWeek -- | The DayOfWeek Wednesday. wednesday :: DayOfWeek -- | The DayOfWeek Thursday. thursday :: DayOfWeek -- | The DayOfWeek Friday. friday :: DayOfWeek -- | The DayOfWeek Saturday. saturday :: DayOfWeek -- | Return the number of days in a given month. daysInMonth :: Bool -> Month -> Int -- | Is the Year a leap year? -- --
--   >>> isLeapYear (Year 1996)
--   True
--   
-- --
--   >>> isLeapYear (Year 2019)
--   False
--   
isLeapYear :: Year -> Bool -- | All UTC time offsets. See List of UTC time offsets. observedOffsets :: Vector Offset -- | Given a Date and a separator, construct a Text -- Builder corresponding to Year/Month/Day encoding. builder_Ymd :: Maybe Char -> Date -> Builder -- | Given a Date and a separator, construct a Text -- Builder corresponding to a Day/Month/Year encoding. builder_Dmy :: Maybe Char -> Date -> Builder -- | Given a SubsecondPrecision and a separator, construct a -- Text Builder corresponding to an Hour/Minute/Second -- encoding. builder_HMS :: SubsecondPrecision -> Maybe Char -> TimeOfDay -> Builder -- | Parse a Year/Month/Day-encoded Date that uses the given -- separator. parser_Ymd :: Maybe Char -> Parser Date -- | Parse a Year/Month/Day-encoded Date that either has no -- separators or uses any non-numeric character for each separator. parser_Ymd_lenient :: Parser Date -- | Parse a Month/Day/Year-encoded Date that uses the given -- separator. parser_Mdy :: Maybe Char -> Parser Date -- | Parse a Month/Day/Year-encoded Date that either has no -- separators or uses any non-numeric character for each separator. parser_Mdy_lenient :: Parser Date -- | Parse a Day/Month/Year-encoded Date that uses the given -- separator. parser_Dmy :: Maybe Char -> Parser Date -- | Parse a Day/Month/Year-encoded Date that either has no -- separators or uses any non-numeric character for each separator. parser_Dmy_lenient :: Parser Date -- | Given a Date and a separator, construct a ByteString -- Builder corresponding to a Day/Month/Year encoding. builderUtf8_Ymd :: Maybe Char -> Date -> Builder -- | Parse a Year/Month/Day-encoded Date that uses the given -- separator. parserUtf8_Ymd :: Maybe Char -> Parser Date -- | Given a MeridiemLocale, a SubsecondPrecision, and a -- separator, construct a Text Builder according to an IMS -- encoding. -- -- This differs from builder_IMSp in that their is a space between -- the seconds and locale. builder_IMS_p :: MeridiemLocale Text -> SubsecondPrecision -> Maybe Char -> TimeOfDay -> Builder -- | Given a MeridiemLocale, a SubsecondPrecision, and a -- separator, construct a Text Builder according to an IMS -- encoding. builder_IMSp :: MeridiemLocale Text -> SubsecondPrecision -> Maybe Char -> TimeOfDay -> Builder -- | Parse an Hour/Minute/Second-encoded TimeOfDay that uses the -- given separator. parser_HMS :: Maybe Char -> Parser TimeOfDay -- | Parses text that is formatted as either of the following: -- -- -- -- That is, the seconds and subseconds part is optional. If it is not -- provided, it is assumed to be zero. This format shows up in Google -- Chrome's datetime-local inputs. parser_HMS_opt_S :: Maybe Char -> Parser TimeOfDay -- | Given a SubsecondPrecision and a separator, construct a -- ByteString Builder corresponding to an Hour/Month/Second -- encoding of the given TimeOfDay. builderUtf8_HMS :: SubsecondPrecision -> Maybe Char -> TimeOfDay -> Builder -- | Given a MeridiemLocale, a SubsecondPrecision, and a -- separator, construct a ByteString Builder corresponding -- to an IMS encoding of the given TimeOfDay. This differs from -- builderUtf8_IMSp in that there is a space between the seconds -- and locale. builderUtf8_IMS_p :: MeridiemLocale ByteString -> SubsecondPrecision -> Maybe Char -> TimeOfDay -> Builder -- | Given a MeridiemLocale, a SubsecondPrecision, and a -- separator, construct a ByteString Builder corresponding -- to an IMS encoding of the given TimeOfDay. builderUtf8_IMSp :: MeridiemLocale ByteString -> SubsecondPrecision -> Maybe Char -> TimeOfDay -> Builder -- | Parse an Hour/Minute/Second-encoded TimeOfDay that uses the -- given separator. parserUtf8_HMS :: Maybe Char -> Parser TimeOfDay -- | Parses text that is formatted as either of the following: -- -- -- -- That is, the seconds and subseconds part is optional. If it is not -- provided, it is assumed to be zero. This format shows up in Google -- Chrome's datetime-local inputs. parserUtf8_HMS_opt_S :: Maybe Char -> Parser TimeOfDay -- | Parse a TimeOfDay that was encoded using the given separator. zeptoUtf8_HMS :: Maybe Char -> Parser TimeOfDay -- | Given a SubsecondPrecision and a DatetimeFormat, -- construct a Text Builder corresponding to a -- Day/Month/Year,Hour/Minute/Second encoding of the given -- Datetime. builder_DmyHMS :: SubsecondPrecision -> DatetimeFormat -> Datetime -> Builder -- | Given a MeridiemLocale, a SubsecondPrecision, and a -- DatetimeFormat, construct a Text Builder -- corresponding to a Day/Month/Year,IMS encoding of the given -- Datetime. builder_DmyIMSp :: MeridiemLocale Text -> SubsecondPrecision -> DatetimeFormat -> Datetime -> Builder -- | Given a MeridiemLocale, a SubsecondPrecision, and a -- DatetimeFormat, construct a Text Builder -- corresponding to a Day/Month/Year,IMS encoding of the given -- Datetime. This differs from builder_DmyIMSp in that it -- adds a space between the locale and seconds. builder_DmyIMS_p :: MeridiemLocale Text -> SubsecondPrecision -> DatetimeFormat -> Datetime -> Builder -- | Given a SubsecondPrecision and a DatetimeFormat, -- construct a Text Builder corresponding to a -- Year/Month/Day,Hour/Minute/Second encoding of the given -- Datetime. builder_YmdHMS :: SubsecondPrecision -> DatetimeFormat -> Datetime -> Builder -- | Given a MeridiemLocale, a SubsecondPrecision, and a -- DatetimeFormat, construct a Text Builder that -- corresponds to a Year/Month/Day,IMS encoding of the given -- Datetime. builder_YmdIMSp :: MeridiemLocale Text -> SubsecondPrecision -> DatetimeFormat -> Datetime -> Builder -- | Given a MeridiemLocale, a SubsecondPrecision, and a -- DatetimeFormat, construct a Text Builder that -- corresponds to a Year/Month/Day,IMS encoding of the given -- Datetime. This inserts a space between the locale and seconds. builder_YmdIMS_p :: MeridiemLocale Text -> SubsecondPrecision -> DatetimeFormat -> Datetime -> Builder -- | Construct a Text Builder corresponding to the W3C -- encoding of the given Datetime. -- -- Deprecated. This is just a poorly named alias for -- builderIso8601. builderW3C :: Datetime -> Builder -- | Construct a Text Builder corresponding to the ISO-8601 -- encoding of the given Datetime. builderIso8601 :: Datetime -> Builder -- | Construct Text corresponding to the ISO-8601 encoding of the -- given Datetime. encodeIso8601 :: Datetime -> Text -- | Given a SubsecondPrecision and DatetimeFormat, construct -- Text that corresponds to a Day/Month/Year,Hour/Minute/Second -- encoding of the given Datetime. encode_DmyHMS :: SubsecondPrecision -> DatetimeFormat -> Datetime -> Text -- | Given a MeridiemLocale, a SubsecondPrecision, and a -- DatetimeFormat, construct Text that corresponds to a -- Day/Month/Year,IMS encoding of the given Datetime. This inserts -- a space between the locale and seconds. encode_DmyIMS_p :: MeridiemLocale Text -> SubsecondPrecision -> DatetimeFormat -> Datetime -> Text -- | Given a SubsecondPrecision and DatetimeFormat, construct -- Text that corresponds to a Year/Month/Day,Hour/Minute/Second -- encoding of the given Datetime. encode_YmdHMS :: SubsecondPrecision -> DatetimeFormat -> Datetime -> Text -- | Given a MeridiemLocale, a SubsecondPrecision, and a -- DatetimeFormat, construct Text that corresponds to a -- Year/Month/Day,IMS encoding of the given Datetime. This inserts -- a space between the locale and seconds. encode_YmdIMS_p :: MeridiemLocale Text -> SubsecondPrecision -> DatetimeFormat -> Datetime -> Text -- | Parse a Day/Month/Year,Hour/Minute/Second-encoded Datetime that -- was encoded with the given DatetimeFormat. parser_DmyHMS :: DatetimeFormat -> Parser Datetime -- | Parse a Day/Month/Year,Hour/Minute/Second-encoded Datetime from -- Text that was encoded with either no separators or any -- non-numeric character for each separator, such as: -- -- 01-05-2017T23:13:05 01-05-2017 23:13:05 01052017 23:13:05 -- 01y01/2018x23;50&29 parser_DmyHMS_lenient :: Parser Datetime -- | Parses a Year/Month/Day,Hour/Minute/Second-encoded Datetime -- that was encoded using the given DatetimeFormat. parser_YmdHMS :: DatetimeFormat -> Parser Datetime -- | Parses a Year/Month/Day,Hour/Minute/Second-encoded Datetime -- that was encoded with either no separators or any non-numeric -- character for each separator. parser_YmdHMS_lenient :: Parser Datetime -- | Parses a Year/Month/Date,Hour/Minute/Second-encoded Datetime -- from Text that was encoded with the given DatetimeFormat -- and with either of the following time formats: -- -- -- -- That is, the seconds and subseconds part is optional. If it is not -- provided, it is assumed to be zero. This format shows up in Google -- Chrome's datetime-local inputs. parser_YmdHMS_opt_S :: DatetimeFormat -> Parser Datetime -- | Parses a Year/Month/Date,Hour/Minute/Second-encoded Datetime -- from Text that was encoded with either no separators or any -- non-numeric character for each separator and with either of the -- following time formats: -- -- -- -- That is, the seconds and subseconds part is optional. If it is not -- provided, it is assumed to be zero. This format shows up in Google -- Chrome's datetime-local inputs. parser_YmdHMS_opt_S_lenient :: Parser Datetime -- | Parses text that is formatted as either of the following: -- -- -- -- That is, the seconds and subseconds part is optional. If it is not -- provided, it is assumed to be zero. This format shows up in Google -- Chrome's datetime-local inputs. parser_DmyHMS_opt_S :: DatetimeFormat -> Parser Datetime -- | Parse a Day/Month/Year,Hour/Minute/Second-encoded Datetime from -- Text that was encoded with either no separators or any -- non-numeric character for each separator and with either of the -- following time formats: -- -- -- -- That is, the seconds and subseconds part is optional. If it is not -- provided, it is assumed to be zero. This format shows up in Google -- Chrome's datetime-local inputs. parser_DmyHMS_opt_S_lenient :: Parser Datetime -- | Parses a Month/Day/Year,Hour/Minute/Second-encoded Datetime -- that was encoded using the given DatetimeFormat. parser_MdyHMS :: DatetimeFormat -> Parser Datetime -- | Parses a Month/Day/Year,Hour/Minute/Second-encoded Datetime -- that was encoded with either no separators or any non-numeric -- character for each separator. parser_MdyHMS_lenient :: Parser Datetime -- | Parse a Month/Day/Year,Hour/Minute/Second-encoded Datetime from -- Text that was encoded with with the given DatetimeFormat -- and with either of the following time formats: -- -- -- -- That is, the seconds and subseconds part is optional. If it is not -- provided, it is assumed to be zero. parser_MdyHMS_opt_S :: DatetimeFormat -> Parser Datetime -- | Parse a Month/Day/Year,Hour/Minute/Second-encoded Datetime from -- Text that was encoded with either no separators or any -- non-numeric character for each separator and with either of the -- following time formats: -- -- -- -- That is, the seconds and subseconds part is optional. If it is not -- provided, it is assumed to be zero. parser_MdyHMS_opt_S_lenient :: Parser Datetime -- | Parses a Datetime from Text that was encoded with any of -- the following formats and with either no separators or any non-numeric -- character for each separator. -- -- -- -- That is, the seconds and subseconds part is optional. If it is not -- provided, it is assumed to be zero. Note that this is the least -- performant parser due to backtracking parser_lenient :: Parser Datetime -- | Decode a Day/Month/Year,Hour/Minute/Second-encoded Datetime -- from Text that was encoded with the given -- DatetimeFormat. decode_DmyHMS :: DatetimeFormat -> Text -> Maybe Datetime -- | Decodes Day/Month/Year,Hour/Minute/Second-encoded Datetime from -- Text that is encoded with either no separators or any -- non-numeric characters as separators, such as: -- -- 2017-01-05T23:13:05 2017-01-05 23:13:05 20170105 23:13:05 -- 2018x01y01/23;50&29 decode_DmyHMS_lenient :: Text -> Maybe Datetime -- | Decode a Month/Day/Year,Hour/Minute/Second-encoded Datetime -- from Text that was encoded with the given -- DatetimeFormat. decode_MdyHMS :: DatetimeFormat -> Text -> Maybe Datetime -- | Decode a Month/Day/Year,Hour/Minute/Second-encoded Datetime -- from Text with either no separators or any non-numeric -- character for each separator. decode_MdyHMS_lenient :: Text -> Maybe Datetime -- | Decode a Month/Day/Year,Hour/Minute/Second-encoded Datetime -- from Text that was encoded with the given DatetimeFormat -- and with either of the following time formats: -- -- -- -- That is, the seconds and subseconds part is optional. If it is not -- provided, it is assumed to be zero. decode_MdyHMS_opt_S :: DatetimeFormat -> Text -> Maybe Datetime -- | Parse a Month/Day/Year,Hour/Minute/Second-encoded Datetime from -- Text with either no separators or any non-numeric character for -- each separator and with either of the following time formats: -- -- -- -- That is, the seconds and subseconds part is optional. If it is not -- provided, it is assumed to be zero. decode_MdyHMS_opt_S_lenient :: Text -> Maybe Datetime -- | Decode a Year/Month/Day,Hour/Minute/Second-encoded Datetime -- from Text that was encoded with the given -- DatetimeFormat. decode_YmdHMS :: DatetimeFormat -> Text -> Maybe Datetime -- | Decode a Year/Month/Day,Hour/Minute/Second-encoded Datetime -- from Text that was encoded with either no separators or any -- non-numeric character for each separator. decode_YmdHMS_lenient :: Text -> Maybe Datetime -- | Decode a Year/Month/Date,Hour/Minute/Second-encoded Datetime -- from Text that was encoded with the given DatetimeFormat -- and with either of the following time formats: -- -- -- -- That is, the seconds and subseconds part is optional. If it is not -- provided, it is assumed to be zero. This format shows up in Google -- Chrome's datetime-local inputs. decode_YmdHMS_opt_S :: DatetimeFormat -> Text -> Maybe Datetime -- | Decode a Year/Month/Date,Hour/Minute/Second-encoded Datetime -- from Text that was encoded with either no separators or any -- non-numeric character for each separator and with either of the -- following time formats: -- -- -- -- That is, the seconds and subseconds part is optional. If it is not -- provided, it is assumed to be zero. This format shows up in Google -- Chrome's datetime-local inputs. decode_YmdHMS_opt_S_lenient :: Text -> Maybe Datetime -- | Decode a Day/Month/Year,Hour/Minute/Second-encoded Datetime -- from Text that was encoded with with the given -- DatetimeFormat and with either of the following time formats: -- -- -- -- That is, the seconds and subseconds part is optional. If it is not -- provided, it is assumed to be zero. This format shows up in Google -- Chrome's datetime-local inputs. decode_DmyHMS_opt_S :: DatetimeFormat -> Text -> Maybe Datetime -- | Decode a Day/Month/Year,Hour/Minute/Second-encoded Datetime -- from Text that was encoded with either no separators or any -- non-numeric character for each separator and with either of the -- following time formats: -- -- -- -- That is, the seconds and subseconds part is optional. If it is not -- provided, it is assumed to be zero. This format shows up in Google -- Chrome's datetime-local inputs. decode_DmyHMS_opt_S_lenient :: Text -> Maybe Datetime -- | Parses text that was encoded in DMY, YMD, or MDY format with optional -- seconds and any non-numeric character as separators. decode_lenient :: Text -> Maybe Datetime -- | Given a SubsecondPrecision and a DatetimeFormat, -- construct a ByteString corresponding to a -- Year/Month/Day,Hour/Minute/Second encoding of the given -- Datetime. encodeUtf8_YmdHMS :: SubsecondPrecision -> DatetimeFormat -> Datetime -> ByteString -- | Given a MeridiemLocale, a SubsecondPrecision, and a -- DatetimeFormat, construct a ByteString corresponding to -- a Year/Month/Day,IMS encoding of the given Datetime. This -- inserts a space between the locale and seconds. encodeUtf8_YmdIMS_p :: MeridiemLocale ByteString -> SubsecondPrecision -> DatetimeFormat -> Datetime -> ByteString -- | Given a SubsecondPrecision and a DatetimeFormat, -- construct a ByteString Builder corresponding to a -- Year/Month/Day,Hour/Minute/Second encoding of the given -- Datetime. builderUtf8_YmdHMS :: SubsecondPrecision -> DatetimeFormat -> Datetime -> Builder -- | Given a SubsecondPrecision and a DatetimeFormat, -- construct a ByteString Builder corresponding to a -- Year/Month/Day,IMS encoding of the given Datetime. builderUtf8_YmdIMSp :: MeridiemLocale ByteString -> SubsecondPrecision -> DatetimeFormat -> Datetime -> Builder -- | Given a SubsecondPrecision and a DatetimeFormat, -- construct a ByteString Builder corresponding to a -- Year/Month/Day,IMS encoding of the given Datetime. This inserts -- a space between the locale and seconds. builderUtf8_YmdIMS_p :: MeridiemLocale ByteString -> SubsecondPrecision -> DatetimeFormat -> Datetime -> Builder -- | Construct a ByteString Builder corresponding to a W3C -- encoding of the given Datetime. builderUtf8W3C :: Datetime -> Builder -- | Decode a Year/Month/Day,Hour/Minute/Second-encoded Datetime -- from a ByteString. decodeUtf8_YmdHMS :: DatetimeFormat -> ByteString -> Maybe Datetime -- | Parses text that is formatted as either of the following: -- -- -- -- That is, the seconds and subseconds part is optional. If it is not -- provided, it is assumed to be zero. This format shows up in Google -- Chrome's datetime-local inputs. decodeUtf8_YmdHMS_opt_S :: DatetimeFormat -> ByteString -> Maybe Datetime -- | Parse a Year/Month/Day,Hour/Minute/Second-encoded Datetime that -- was encoded using the given DatetimeFormat. parserUtf8_YmdHMS :: DatetimeFormat -> Parser Datetime -- | Parses text that is formatted as either of the following: -- -- -- -- That is, the seconds and subseconds part is optional. If it is not -- provided, it is assumed to be zero. This format shows up in Google -- Chrome's datetime-local inputs. parserUtf8_YmdHMS_opt_S :: DatetimeFormat -> Parser Datetime -- | Parse a Datetime that was encoded using the given -- DatetimeFormat. zeptoUtf8_YmdHMS :: DatetimeFormat -> Parser Datetime -- | Given an OffsetFormat, a SubsecondPrecision, and a -- DatetimeFormat, construct Text corresponding to the -- Year/Month/Day,Hour/Minute/Second-encoding of the given -- OffsetDatetime. encode_YmdHMSz :: OffsetFormat -> SubsecondPrecision -> DatetimeFormat -> OffsetDatetime -> Text -- | Given an OffsetFormat, a SubsecondPrecision, and a -- DatetimeFormat, construct Text corresponding to the -- Day/Month/Year,Hour/Minute/Second encoding of the given -- OffsetDatetime. encode_DmyHMSz :: OffsetFormat -> SubsecondPrecision -> DatetimeFormat -> OffsetDatetime -> Text -- | Given an OffsetFormat, a SubsecondPrecision, and a -- DatetimeFormat, construct a Text Builder -- corresponding to a Year/Month/Day,Hour/Minute/Second encoding of the -- given OffsetDatetime. builder_YmdHMSz :: OffsetFormat -> SubsecondPrecision -> DatetimeFormat -> OffsetDatetime -> Builder -- | Given an OffsetFormat, a SubsecondPrecision, and a -- DatetimeFormat, construct a Text Builder -- corresponding to the Day/Month/Year,Hour/Minute/Second-encoding of the -- given OffsetDatetime. builder_DmyHMSz :: OffsetFormat -> SubsecondPrecision -> DatetimeFormat -> OffsetDatetime -> Builder -- | Parse a Year/Month/Day,Hour/Minute/Second-encoded -- OffsetDatetime that was encoded using the given -- OffsetFormat and DatetimeFormat. parser_YmdHMSz :: OffsetFormat -> DatetimeFormat -> Parser OffsetDatetime -- | Parse a Day/Month/Year,Hour/Minute/Second-encoded -- OffsetDatetime that was encoded using the given -- OffsetFormat and DatetimeFormat. parser_DmyHMSz :: OffsetFormat -> DatetimeFormat -> Parser OffsetDatetime -- | Given an OffsetFormat, a MeridiemLocale, a -- SubsecondPrecision, and DatetimeFormat, construct a -- Text Builder corresponding to a -- Year/Month/Day,IMS-encoding of the given OffsetDatetime. builder_YmdIMS_p_z :: OffsetFormat -> MeridiemLocale Text -> SubsecondPrecision -> DatetimeFormat -> OffsetDatetime -> Builder -- | Given an OffsetFormat, a MeridiemLocale, a -- SubsecondPrecision, and a DatetimeFormat, construct a -- Text Builder corresponding to the Day/Month/Year,IMS -- encoding of the given OffsetDatetime. builder_DmyIMS_p_z :: OffsetFormat -> MeridiemLocale Text -> SubsecondPrecision -> DatetimeFormat -> OffsetDatetime -> Builder -- | Construct a Text Builder corresponding to the -- w3c-formatting of the given OffsetDatetime. builderW3Cz :: OffsetDatetime -> Builder -- | Given an OffsetFormat, a SubsecondPrecision, and a -- DatetimeFormat, construct a ByteString Builder -- corresponding to the Year/Month/Day,Hour/Minute/Second encoding of the -- given OffsetDatetime. builderUtf8_YmdHMSz :: OffsetFormat -> SubsecondPrecision -> DatetimeFormat -> OffsetDatetime -> Builder -- | Parse a Year/Month/Day,Hour/Minute/Second-encoded -- OffsetDatetime that was encoded using the given -- OffsetFormat and DatetimeFormat. parserUtf8_YmdHMSz :: OffsetFormat -> DatetimeFormat -> Parser OffsetDatetime -- | Given an OffsetFormat, a 'MeridiemLocale, a -- SubsecondPrecision, and a DatetimeFormat, construct a -- ByteString Builder corresponding to a -- Year/Month/Day,IMS-encoded OffsetDatetime. builderUtf8_YmdIMS_p_z :: OffsetFormat -> MeridiemLocale ByteString -> SubsecondPrecision -> DatetimeFormat -> OffsetDatetime -> Builder -- | Construct a ByteString Builder corresponding to the W3C -- encoding of the given Datetime. builderUtf8W3Cz :: OffsetDatetime -> Builder -- | Encode an Offset to Text using the given -- OffsetFormat. encodeOffset :: OffsetFormat -> Offset -> Text -- | Construct a Builder corresponding to the given Offset -- encoded using the given OffsetFormat. builderOffset :: OffsetFormat -> Offset -> Builder -- | Decode an Offset from Text that was encoded using the -- given OffsetFormat. decodeOffset :: OffsetFormat -> Text -> Maybe Offset -- | Parse an Offset that was encoded using the given -- OffsetFormat. parserOffset :: OffsetFormat -> Parser Offset -- | Encode an Offset as a ByteString using the given -- OffsetFormat. encodeOffsetUtf8 :: OffsetFormat -> Offset -> ByteString -- | Construct a ByteString Builder corresponding to the -- encoding of an Offset using the given OffsetFormat. builderOffsetUtf8 :: OffsetFormat -> Offset -> Builder -- | Decode an Offset from a ByteString that was encoded -- using the given OffsetFormat. decodeOffsetUtf8 :: OffsetFormat -> ByteString -> Maybe Offset -- | Parse an Offset that was encoded using the given -- OffsetFormat. parserOffsetUtf8 :: OffsetFormat -> Parser Offset -- | Encode a Timespan as Text using the given -- SubsecondPrecision. encodeTimespan :: SubsecondPrecision -> Timespan -> Text -- | Construct a Text Builder corresponding to an encoding of -- the given Timespan using the given SubsecondPrecision. builderTimespan :: SubsecondPrecision -> Timespan -> Builder -- | Given a SubsecondPrecision, construct a ByteString -- corresponding to an encoding of the given Timespan. encodeTimespanUtf8 :: SubsecondPrecision -> Timespan -> ByteString -- | Given a SubsecondPrecision, construct a ByteString -- Builder corresponding to an encoding of the given -- Timespan. builderTimespanUtf8 :: SubsecondPrecision -> Timespan -> Builder -- | Is the given Time within the TimeInterval? within :: Time -> TimeInterval -> Bool -- | Convert a TimeInterval to a Timespan. This is equivalent -- to width. timeIntervalToTimespan :: TimeInterval -> Timespan -- | The TimeInterval that covers the entire range of Times -- that Chronos supports. -- --
--   \(t :: Time) -> within t whole
--   
whole :: TimeInterval -- | The singleton (degenerate) TimeInterval. singleton :: Time -> TimeInterval -- | Get the lower bound of the TimeInterval. lowerBound :: TimeInterval -> Time -- | Get the upper bound of the TimeInterval. upperBound :: TimeInterval -> Time -- | The width of the TimeInterval. This is equivalent to -- timeIntervalToTimespan. width :: TimeInterval -> Timespan -- | A smart constructor for TimeInterval. In general, you should -- prefer using this over the TimeInterval constructor, since it -- maintains the invariant that lowerBound interval -- <= upperBound interval. timeIntervalBuilder :: Time -> Time -> TimeInterval -- | An infix timeIntervalBuilder. (...) :: Time -> Time -> TimeInterval infix 3 ... -- | A day represented as the modified Julian date, the number of days -- since midnight on November 17, 1858. newtype Day Day :: Int -> Day [getDay] :: Day -> Int -- | The day of the week. newtype DayOfWeek DayOfWeek :: Int -> DayOfWeek [getDayOfWeek] :: DayOfWeek -> Int -- | The day of the month. newtype DayOfMonth DayOfMonth :: Int -> DayOfMonth [getDayOfMonth] :: DayOfMonth -> Int -- | The day of the year. newtype DayOfYear DayOfYear :: Int -> DayOfYear [getDayOfYear] :: DayOfYear -> Int -- | The month of the year. newtype Month Month :: Int -> Month [getMonth] :: Month -> Int -- | The number of years elapsed since the beginning of the Common Era. newtype Year Year :: Int -> Year [getYear] :: Year -> Int -- | A UTC offset. newtype Offset Offset :: Int -> Offset [getOffset] :: Offset -> Int -- | POSIX time with nanosecond resolution. newtype Time Time :: Int64 -> Time [getTime] :: Time -> Int64 -- | Match a DayOfWeek. By match, we mean that a -- DayOfWeekMatch is a mapping from the integer value of a -- DayOfWeek to some value of type a. You should -- construct a DayOfWeekMatch with buildDayOfWeekMatch, and -- match it using caseDayOfWeek. newtype DayOfWeekMatch a DayOfWeekMatch :: Vector a -> DayOfWeekMatch a [getDayOfWeekMatch] :: DayOfWeekMatch a -> Vector a -- | Match a Month. By match, we mean that a -- MonthMatch is a mapping from the integer value of a -- Month to some value of type a. You should construct a -- MonthMatch with buildMonthMatch, and match it using -- caseMonth. newtype MonthMatch a MonthMatch :: Vector a -> MonthMatch a [getMonthMatch] :: MonthMatch a -> Vector a -- | Like MonthMatch, but the matched value can have an instance of -- Unbox. newtype UnboxedMonthMatch a UnboxedMonthMatch :: Vector a -> UnboxedMonthMatch a [getUnboxedMonthMatch] :: UnboxedMonthMatch a -> Vector a -- | A timespan. This is represented internally as a number of nanoseconds. newtype Timespan Timespan :: Int64 -> Timespan [getTimespan] :: Timespan -> Int64 -- | The precision used when encoding seconds to a human-readable format. data SubsecondPrecision -- | Rounds to second, millisecond, microsecond, or nanosecond SubsecondPrecisionAuto :: SubsecondPrecision -- | Specify number of places after decimal SubsecondPrecisionFixed :: {-# UNPACK #-} !Int -> SubsecondPrecision -- | A date as represented by the Gregorian calendar. data Date Date :: {-# UNPACK #-} !Year -> {-# UNPACK #-} !Month -> {-# UNPACK #-} !DayOfMonth -> Date [dateYear] :: Date -> {-# UNPACK #-} !Year [dateMonth] :: Date -> {-# UNPACK #-} !Month [dateDay] :: Date -> {-# UNPACK #-} !DayOfMonth -- | An OrdinalDate is a Year and the number of days elapsed -- since the Year began. data OrdinalDate OrdinalDate :: {-# UNPACK #-} !Year -> {-# UNPACK #-} !DayOfYear -> OrdinalDate [ordinalDateYear] :: OrdinalDate -> {-# UNPACK #-} !Year [ordinalDateDayOfYear] :: OrdinalDate -> {-# UNPACK #-} !DayOfYear -- | A month and the day of the month. This does not actually represent a -- specific date, since this recurs every year. data MonthDate MonthDate :: {-# UNPACK #-} !Month -> {-# UNPACK #-} !DayOfMonth -> MonthDate [monthDateMonth] :: MonthDate -> {-# UNPACK #-} !Month [monthDateDay] :: MonthDate -> {-# UNPACK #-} !DayOfMonth -- | A Date as represented by the Gregorian calendar and a -- TimeOfDay. While the ToJSON instance encodes with a -- hyphen separator, the FromJSON instance allows any non-digit -- character to act as separator, using the lenient parser. data Datetime Datetime :: {-# UNPACK #-} !Date -> {-# UNPACK #-} !TimeOfDay -> Datetime [datetimeDate] :: Datetime -> {-# UNPACK #-} !Date [datetimeTime] :: Datetime -> {-# UNPACK #-} !TimeOfDay -- | A Datetime with a time zone Offset. data OffsetDatetime OffsetDatetime :: {-# UNPACK #-} !Datetime -> {-# UNPACK #-} !Offset -> OffsetDatetime [offsetDatetimeDatetime] :: OffsetDatetime -> {-# UNPACK #-} !Datetime [offsetDatetimeOffset] :: OffsetDatetime -> {-# UNPACK #-} !Offset -- | A time of day with nanosecond resolution. data TimeOfDay TimeOfDay :: {-# UNPACK #-} !Int -> {-# UNPACK #-} !Int -> {-# UNPACK #-} !Int64 -> TimeOfDay [timeOfDayHour] :: TimeOfDay -> {-# UNPACK #-} !Int [timeOfDayMinute] :: TimeOfDay -> {-# UNPACK #-} !Int [timeOfDayNanoseconds] :: TimeOfDay -> {-# UNPACK #-} !Int64 -- | The format of a Datetime. In particular this provides -- separators for parts of the Datetime and nothing else. data DatetimeFormat DatetimeFormat :: !Maybe Char -> !Maybe Char -> !Maybe Char -> DatetimeFormat -- | Separator in the date [datetimeFormatDateSeparator] :: DatetimeFormat -> !Maybe Char -- | Separator between date and time [datetimeFormatSeparator] :: DatetimeFormat -> !Maybe Char -- | Separator in the time [datetimeFormatTimeSeparator] :: DatetimeFormat -> !Maybe Char -- | Formatting settings for a timezone offset. data OffsetFormat -- | %z (e.g., -0400) OffsetFormatColonOff :: OffsetFormat -- | %:z (e.g., -04:00) OffsetFormatColonOn :: OffsetFormat -- | %::z (e.g., -04:00:00) OffsetFormatSecondsPrecision :: OffsetFormat -- | %:::z (e.g., -04, +05:30) OffsetFormatColonAuto :: OffsetFormat -- | Locale-specific formatting for weekdays and months. The type variable -- will likely be instantiated to Text or ByteString. data DatetimeLocale a DatetimeLocale :: !DayOfWeekMatch a -> !DayOfWeekMatch a -> !MonthMatch a -> !MonthMatch a -> DatetimeLocale a -- | full weekdays starting with Sunday, 7 elements [datetimeLocaleDaysOfWeekFull] :: DatetimeLocale a -> !DayOfWeekMatch a -- | abbreviated weekdays starting with Sunday, 7 elements [datetimeLocaleDaysOfWeekAbbreviated] :: DatetimeLocale a -> !DayOfWeekMatch a -- | full months starting with January, 12 elements [datetimeLocaleMonthsFull] :: DatetimeLocale a -> !MonthMatch a -- | abbreviated months starting with January, 12 elements [datetimeLocaleMonthsAbbreviated] :: DatetimeLocale a -> !MonthMatch a -- | Locale-specific formatting for AM and PM. data MeridiemLocale a MeridiemLocale :: !a -> !a -> MeridiemLocale a [meridiemLocaleAm] :: MeridiemLocale a -> !a [meridiemLocalePm] :: MeridiemLocale a -> !a -- | A TimeInterval represents a start and end time. It can sometimes be -- more ergonomic than the Torsor API when you only care about -- whether or not a Time is within a certain range. -- -- To construct a TimeInterval, it is best to use -- timeIntervalBuilder, which maintains the invariant that -- lowerBound interval <= upperBound -- interval (all functions that act on TimeIntervals assume -- this invariant). data TimeInterval TimeInterval :: {-# UNPACK #-} !Time -> {-# UNPACK #-} !Time -> TimeInterval -- | Holds all of the parts encoded by a Time. Can be used for -- formatting if what is presently in the API does not suffice. data TimeParts TimeParts :: !Int -> !Int -> !Int -> !Int -> !Int -> !Int -> !Int -> !Int -> TimeParts -- | days 0-31 [timePartsDay] :: TimeParts -> !Int -- | months 0-11 [timePartsMonth] :: TimeParts -> !Int [timePartsYear] :: TimeParts -> !Int -- | hours 0-23 [timePartsHour] :: TimeParts -> !Int -- | minutes 0-59 [timePartsMinute] :: TimeParts -> !Int -- | seconds 0-59 [timePartsSecond] :: TimeParts -> !Int -- | fraction of a second with nanosecond resolution [timePartsSubsecond] :: TimeParts -> !Int [timePartsOffset] :: TimeParts -> !Int instance Control.DeepSeq.NFData Chronos.Day instance Data.Primitive.Types.Prim Chronos.Day instance Foreign.Storable.Storable Chronos.Day instance Data.Aeson.Types.FromJSON.FromJSON Chronos.Day instance Data.Aeson.Types.ToJSON.ToJSON Chronos.Day instance GHC.Enum.Enum Chronos.Day instance Data.Hashable.Class.Hashable Chronos.Day instance GHC.Classes.Ord Chronos.Day instance GHC.Classes.Eq Chronos.Day instance GHC.Read.Read Chronos.Day instance GHC.Show.Show Chronos.Day instance Control.DeepSeq.NFData Chronos.DayOfWeek instance Data.Hashable.Class.Hashable Chronos.DayOfWeek instance GHC.Classes.Ord Chronos.DayOfWeek instance GHC.Classes.Eq Chronos.DayOfWeek instance GHC.Read.Read Chronos.DayOfWeek instance GHC.Show.Show Chronos.DayOfWeek instance Control.DeepSeq.NFData Chronos.DayOfMonth instance GHC.Enum.Enum Chronos.DayOfMonth instance Data.Primitive.Types.Prim Chronos.DayOfMonth instance GHC.Classes.Ord Chronos.DayOfMonth instance GHC.Classes.Eq Chronos.DayOfMonth instance GHC.Read.Read Chronos.DayOfMonth instance GHC.Show.Show Chronos.DayOfMonth instance Control.DeepSeq.NFData Chronos.DayOfYear instance Data.Primitive.Types.Prim Chronos.DayOfYear instance GHC.Classes.Ord Chronos.DayOfYear instance GHC.Classes.Eq Chronos.DayOfYear instance GHC.Read.Read Chronos.DayOfYear instance GHC.Show.Show Chronos.DayOfYear instance Control.DeepSeq.NFData Chronos.Month instance Data.Primitive.Types.Prim Chronos.Month instance GHC.Classes.Ord Chronos.Month instance GHC.Classes.Eq Chronos.Month instance GHC.Read.Read Chronos.Month instance GHC.Show.Show Chronos.Month instance Control.DeepSeq.NFData Chronos.Year instance GHC.Classes.Ord Chronos.Year instance GHC.Classes.Eq Chronos.Year instance GHC.Read.Read Chronos.Year instance GHC.Show.Show Chronos.Year instance Control.DeepSeq.NFData Chronos.Offset instance GHC.Enum.Enum Chronos.Offset instance GHC.Classes.Ord Chronos.Offset instance GHC.Classes.Eq Chronos.Offset instance GHC.Read.Read Chronos.Offset instance GHC.Show.Show Chronos.Offset instance Control.DeepSeq.NFData Chronos.Time instance GHC.Enum.Bounded Chronos.Time instance Data.Primitive.Types.Prim Chronos.Time instance Foreign.Storable.Storable Chronos.Time instance GHC.Read.Read Chronos.Time instance GHC.Show.Show Chronos.Time instance GHC.Classes.Ord Chronos.Time instance GHC.Classes.Eq Chronos.Time instance Data.Hashable.Class.Hashable Chronos.Time instance Data.Aeson.Types.ToJSON.ToJSON Chronos.Time instance Data.Aeson.Types.FromJSON.FromJSON Chronos.Time instance Control.DeepSeq.NFData a => Control.DeepSeq.NFData (Chronos.DayOfWeekMatch a) instance Control.DeepSeq.NFData a => Control.DeepSeq.NFData (Chronos.MonthMatch a) instance Control.DeepSeq.NFData (Chronos.UnboxedMonthMatch a) instance Control.DeepSeq.NFData Chronos.Timespan instance Torsor.Additive Chronos.Timespan instance Data.Aeson.Types.FromJSON.FromJSON Chronos.Timespan instance Data.Aeson.Types.ToJSON.ToJSON Chronos.Timespan instance GHC.Classes.Ord Chronos.Timespan instance GHC.Classes.Eq Chronos.Timespan instance GHC.Read.Read Chronos.Timespan instance GHC.Show.Show Chronos.Timespan instance GHC.Read.Read Chronos.SubsecondPrecision instance GHC.Show.Show Chronos.SubsecondPrecision instance GHC.Classes.Ord Chronos.SubsecondPrecision instance GHC.Classes.Eq Chronos.SubsecondPrecision instance GHC.Classes.Ord Chronos.Date instance GHC.Classes.Eq Chronos.Date instance GHC.Read.Read Chronos.Date instance GHC.Show.Show Chronos.Date instance GHC.Classes.Ord Chronos.OrdinalDate instance GHC.Classes.Eq Chronos.OrdinalDate instance GHC.Read.Read Chronos.OrdinalDate instance GHC.Show.Show Chronos.OrdinalDate instance GHC.Classes.Ord Chronos.MonthDate instance GHC.Classes.Eq Chronos.MonthDate instance GHC.Read.Read Chronos.MonthDate instance GHC.Show.Show Chronos.MonthDate instance GHC.Classes.Ord Chronos.TimeOfDay instance GHC.Classes.Eq Chronos.TimeOfDay instance GHC.Read.Read Chronos.TimeOfDay instance GHC.Show.Show Chronos.TimeOfDay instance GHC.Classes.Ord Chronos.Datetime instance GHC.Classes.Eq Chronos.Datetime instance GHC.Read.Read Chronos.Datetime instance GHC.Show.Show Chronos.Datetime instance GHC.Classes.Ord Chronos.OffsetDatetime instance GHC.Classes.Eq Chronos.OffsetDatetime instance GHC.Read.Read Chronos.OffsetDatetime instance GHC.Show.Show Chronos.OffsetDatetime instance GHC.Classes.Ord Chronos.DatetimeFormat instance GHC.Classes.Eq Chronos.DatetimeFormat instance GHC.Read.Read Chronos.DatetimeFormat instance GHC.Show.Show Chronos.DatetimeFormat instance GHC.Generics.Generic Chronos.OffsetFormat instance GHC.Enum.Bounded Chronos.OffsetFormat instance GHC.Enum.Enum Chronos.OffsetFormat instance GHC.Classes.Ord Chronos.OffsetFormat instance GHC.Classes.Eq Chronos.OffsetFormat instance GHC.Read.Read Chronos.OffsetFormat instance GHC.Show.Show Chronos.OffsetFormat instance GHC.Enum.Bounded Chronos.TimeInterval instance GHC.Classes.Ord Chronos.TimeInterval instance GHC.Classes.Eq Chronos.TimeInterval instance GHC.Show.Show Chronos.TimeInterval instance GHC.Read.Read Chronos.TimeInterval instance GHC.Classes.Ord a => GHC.Classes.Ord (Chronos.MeridiemLocale a) instance GHC.Classes.Eq a => GHC.Classes.Eq (Chronos.MeridiemLocale a) instance GHC.Show.Show a => GHC.Show.Show (Chronos.MeridiemLocale a) instance GHC.Read.Read a => GHC.Read.Read (Chronos.MeridiemLocale a) instance GHC.Show.Show Chronos.TimeParts instance GHC.Read.Read Chronos.TimeParts instance GHC.Classes.Eq Chronos.TimeParts instance Control.DeepSeq.NFData Chronos.TimeParts instance Control.DeepSeq.NFData a => Control.DeepSeq.NFData (Chronos.MeridiemLocale a) instance Control.DeepSeq.NFData Chronos.TimeInterval instance Control.DeepSeq.NFData a => Control.DeepSeq.NFData (Chronos.DatetimeLocale a) instance Control.DeepSeq.NFData Chronos.OffsetFormat instance Data.Aeson.Types.ToJSON.ToJSON Chronos.Offset instance Data.Aeson.Types.ToJSON.ToJSONKey Chronos.Offset instance Control.DeepSeq.NFData Chronos.DatetimeFormat instance Control.DeepSeq.NFData Chronos.OffsetDatetime instance Control.DeepSeq.NFData Chronos.Datetime instance Data.Aeson.Types.ToJSON.ToJSON Chronos.Datetime instance Data.Aeson.Types.FromJSON.FromJSON Chronos.Datetime instance Control.DeepSeq.NFData Chronos.TimeOfDay instance Control.DeepSeq.NFData Chronos.MonthDate instance Control.DeepSeq.NFData Chronos.OrdinalDate instance Torsor.Torsor Chronos.OrdinalDate GHC.Types.Int instance GHC.Enum.Enum Chronos.OrdinalDate instance Control.DeepSeq.NFData Chronos.Date instance Torsor.Torsor Chronos.Date GHC.Types.Int instance GHC.Enum.Enum Chronos.Date instance Control.DeepSeq.NFData Chronos.SubsecondPrecision instance GHC.Base.Semigroup Chronos.Timespan instance GHC.Base.Monoid Chronos.Timespan instance Torsor.Torsor Chronos.Time Chronos.Timespan instance Torsor.Scaling Chronos.Timespan GHC.Int.Int64 instance Torsor.Torsor Chronos.Offset GHC.Types.Int instance Data.Aeson.Types.FromJSON.FromJSON Chronos.Offset instance Data.Aeson.Types.FromJSON.FromJSONKey Chronos.Offset instance GHC.Enum.Enum Chronos.Month instance GHC.Enum.Bounded Chronos.Month instance Data.Vector.Unboxed.Base.Unbox Chronos.Month instance Data.Vector.Generic.Mutable.Base.MVector Data.Vector.Unboxed.Base.MVector Chronos.Month instance Data.Vector.Generic.Base.Vector Data.Vector.Unboxed.Base.Vector Chronos.Month instance Data.Vector.Unboxed.Base.Unbox Chronos.DayOfMonth instance Data.Vector.Generic.Mutable.Base.MVector Data.Vector.Unboxed.Base.MVector Chronos.DayOfMonth instance Data.Vector.Generic.Base.Vector Data.Vector.Unboxed.Base.Vector Chronos.DayOfMonth instance Torsor.Torsor Chronos.Day GHC.Types.Int -- | Data types for representing different date and time-related -- information. -- -- Internally, the types Int and Int64 are used to -- represent everything. These are used even when negative values are not -- appropriate and even if a smaller fixed-size integer could hold the -- information. The only cases when Int64 is used are when it is -- neccessary to represent values with numbers 2^29 or higher. -- These are typically fields that represent nanoseconds. -- -- Unlike the types in the venerable time library, the types -- here do not allow the user to work with all dates. Since this library -- uses fixed-precision integral values instead of Integer, all of -- the usual problems with overflow should be considered. Notably, -- PosixTime and TaiTime can only be used to represent -- time between the years 1680 and 2260. All other types in this library -- correctly represent time a million years before or after 1970. -- -- The vector unbox instances store data in a reasonably compact manner. -- For example, the instance for Day has three unboxed vectors: -- Int for the year, Int8 for the month, and -- Int8 for the day. This only causes corruption of data if the -- user is trying to use out-of-bounds values for the month and the day. -- Users are advised to not use the data types provided here to model -- non-existent times. module Chronos.Types -- | A day represented as the modified Julian date, the number of days -- since midnight on November 17, 1858. newtype Day Day :: Int -> Day [getDay] :: Day -> Int -- | The day of the week. newtype DayOfWeek DayOfWeek :: Int -> DayOfWeek [getDayOfWeek] :: DayOfWeek -> Int -- | The day of the month. newtype DayOfMonth DayOfMonth :: Int -> DayOfMonth [getDayOfMonth] :: DayOfMonth -> Int -- | The day of the year. newtype DayOfYear DayOfYear :: Int -> DayOfYear [getDayOfYear] :: DayOfYear -> Int -- | The month of the year. newtype Month Month :: Int -> Month [getMonth] :: Month -> Int -- | The number of years elapsed since the beginning of the Common Era. newtype Year Year :: Int -> Year [getYear] :: Year -> Int -- | A UTC offset. newtype Offset Offset :: Int -> Offset [getOffset] :: Offset -> Int -- | POSIX time with nanosecond resolution. newtype Time Time :: Int64 -> Time [getTime] :: Time -> Int64 -- | Match a DayOfWeek. By match, we mean that a -- DayOfWeekMatch is a mapping from the integer value of a -- DayOfWeek to some value of type a. You should -- construct a DayOfWeekMatch with buildDayOfWeekMatch, and -- match it using caseDayOfWeek. newtype DayOfWeekMatch a DayOfWeekMatch :: Vector a -> DayOfWeekMatch a [getDayOfWeekMatch] :: DayOfWeekMatch a -> Vector a -- | Match a Month. By match, we mean that a -- MonthMatch is a mapping from the integer value of a -- Month to some value of type a. You should construct a -- MonthMatch with buildMonthMatch, and match it using -- caseMonth. newtype MonthMatch a MonthMatch :: Vector a -> MonthMatch a [getMonthMatch] :: MonthMatch a -> Vector a -- | Like MonthMatch, but the matched value can have an instance of -- Unbox. newtype UnboxedMonthMatch a UnboxedMonthMatch :: Vector a -> UnboxedMonthMatch a [getUnboxedMonthMatch] :: UnboxedMonthMatch a -> Vector a -- | A timespan. This is represented internally as a number of nanoseconds. newtype Timespan Timespan :: Int64 -> Timespan [getTimespan] :: Timespan -> Int64 -- | The precision used when encoding seconds to a human-readable format. data SubsecondPrecision -- | Rounds to second, millisecond, microsecond, or nanosecond SubsecondPrecisionAuto :: SubsecondPrecision -- | Specify number of places after decimal SubsecondPrecisionFixed :: {-# UNPACK #-} !Int -> SubsecondPrecision -- | A date as represented by the Gregorian calendar. data Date Date :: {-# UNPACK #-} !Year -> {-# UNPACK #-} !Month -> {-# UNPACK #-} !DayOfMonth -> Date [dateYear] :: Date -> {-# UNPACK #-} !Year [dateMonth] :: Date -> {-# UNPACK #-} !Month [dateDay] :: Date -> {-# UNPACK #-} !DayOfMonth -- | An OrdinalDate is a Year and the number of days elapsed -- since the Year began. data OrdinalDate OrdinalDate :: {-# UNPACK #-} !Year -> {-# UNPACK #-} !DayOfYear -> OrdinalDate [ordinalDateYear] :: OrdinalDate -> {-# UNPACK #-} !Year [ordinalDateDayOfYear] :: OrdinalDate -> {-# UNPACK #-} !DayOfYear -- | A month and the day of the month. This does not actually represent a -- specific date, since this recurs every year. data MonthDate MonthDate :: {-# UNPACK #-} !Month -> {-# UNPACK #-} !DayOfMonth -> MonthDate [monthDateMonth] :: MonthDate -> {-# UNPACK #-} !Month [monthDateDay] :: MonthDate -> {-# UNPACK #-} !DayOfMonth -- | A Date as represented by the Gregorian calendar and a -- TimeOfDay. While the ToJSON instance encodes with a -- hyphen separator, the FromJSON instance allows any non-digit -- character to act as separator, using the lenient parser. data Datetime Datetime :: {-# UNPACK #-} !Date -> {-# UNPACK #-} !TimeOfDay -> Datetime [datetimeDate] :: Datetime -> {-# UNPACK #-} !Date [datetimeTime] :: Datetime -> {-# UNPACK #-} !TimeOfDay -- | A Datetime with a time zone Offset. data OffsetDatetime OffsetDatetime :: {-# UNPACK #-} !Datetime -> {-# UNPACK #-} !Offset -> OffsetDatetime [offsetDatetimeDatetime] :: OffsetDatetime -> {-# UNPACK #-} !Datetime [offsetDatetimeOffset] :: OffsetDatetime -> {-# UNPACK #-} !Offset -- | A time of day with nanosecond resolution. data TimeOfDay TimeOfDay :: {-# UNPACK #-} !Int -> {-# UNPACK #-} !Int -> {-# UNPACK #-} !Int64 -> TimeOfDay [timeOfDayHour] :: TimeOfDay -> {-# UNPACK #-} !Int [timeOfDayMinute] :: TimeOfDay -> {-# UNPACK #-} !Int [timeOfDayNanoseconds] :: TimeOfDay -> {-# UNPACK #-} !Int64 -- | The format of a Datetime. In particular this provides -- separators for parts of the Datetime and nothing else. data DatetimeFormat DatetimeFormat :: !Maybe Char -> !Maybe Char -> !Maybe Char -> DatetimeFormat -- | Separator in the date [datetimeFormatDateSeparator] :: DatetimeFormat -> !Maybe Char -- | Separator between date and time [datetimeFormatSeparator] :: DatetimeFormat -> !Maybe Char -- | Separator in the time [datetimeFormatTimeSeparator] :: DatetimeFormat -> !Maybe Char -- | Formatting settings for a timezone offset. data OffsetFormat -- | %z (e.g., -0400) OffsetFormatColonOff :: OffsetFormat -- | %:z (e.g., -04:00) OffsetFormatColonOn :: OffsetFormat -- | %::z (e.g., -04:00:00) OffsetFormatSecondsPrecision :: OffsetFormat -- | %:::z (e.g., -04, +05:30) OffsetFormatColonAuto :: OffsetFormat -- | Locale-specific formatting for weekdays and months. The type variable -- will likely be instantiated to Text or ByteString. data DatetimeLocale a DatetimeLocale :: !DayOfWeekMatch a -> !DayOfWeekMatch a -> !MonthMatch a -> !MonthMatch a -> DatetimeLocale a -- | full weekdays starting with Sunday, 7 elements [datetimeLocaleDaysOfWeekFull] :: DatetimeLocale a -> !DayOfWeekMatch a -- | abbreviated weekdays starting with Sunday, 7 elements [datetimeLocaleDaysOfWeekAbbreviated] :: DatetimeLocale a -> !DayOfWeekMatch a -- | full months starting with January, 12 elements [datetimeLocaleMonthsFull] :: DatetimeLocale a -> !MonthMatch a -- | abbreviated months starting with January, 12 elements [datetimeLocaleMonthsAbbreviated] :: DatetimeLocale a -> !MonthMatch a -- | Locale-specific formatting for AM and PM. data MeridiemLocale a MeridiemLocale :: !a -> !a -> MeridiemLocale a [meridiemLocaleAm] :: MeridiemLocale a -> !a [meridiemLocalePm] :: MeridiemLocale a -> !a -- | A TimeInterval represents a start and end time. It can sometimes be -- more ergonomic than the Torsor API when you only care about -- whether or not a Time is within a certain range. -- -- To construct a TimeInterval, it is best to use -- timeIntervalBuilder, which maintains the invariant that -- lowerBound interval <= upperBound -- interval (all functions that act on TimeIntervals assume -- this invariant). data TimeInterval TimeInterval :: {-# UNPACK #-} !Time -> {-# UNPACK #-} !Time -> TimeInterval -- | Holds all of the parts encoded by a Time. Can be used for -- formatting if what is presently in the API does not suffice. data TimeParts TimeParts :: !Int -> !Int -> !Int -> !Int -> !Int -> !Int -> !Int -> !Int -> TimeParts -- | days 0-31 [timePartsDay] :: TimeParts -> !Int -- | months 0-11 [timePartsMonth] :: TimeParts -> !Int [timePartsYear] :: TimeParts -> !Int -- | hours 0-23 [timePartsHour] :: TimeParts -> !Int -- | minutes 0-59 [timePartsMinute] :: TimeParts -> !Int -- | seconds 0-59 [timePartsSecond] :: TimeParts -> !Int -- | fraction of a second with nanosecond resolution [timePartsSubsecond] :: TimeParts -> !Int [timePartsOffset] :: TimeParts -> !Int -- | This module provides some english locale helpers. It is very -- incomplete. Please send a pull request to -- https://github.com/andrewthad/chronos if you need additions to -- this API. module Chronos.Locale.English -- | Lowercase "am"/"pm". lower :: MeridiemLocale Text -- | Uppercase AM/PM. upper :: MeridiemLocale Text -- | Lowercase "a.m."/"p.m." lowerDots :: MeridiemLocale Text -- | Uppercase "A.M."/"P.M." upperDots :: MeridiemLocale Text -- | Abbreviated Months of the year. -- --
--   >>> caseMonth abbreviated october
--   "Oct"
--   
-- --
--   >>> caseMonth abbreviated august
--   "Aug"
--   
abbreviated :: MonthMatch Text -- | Unabbreviated Months of the year. -- --
--   >>> caseMonth unabbreviated january
--   "January"
--   
-- --
--   >>> caseMonth unabbreviated december
--   "December"
--   
unabbreviated :: MonthMatch Text