PG<3      !"#$%&'()*+,-./012NoneC$8Simple representation of a time interval of a picosecond4Simple representation of a time interval of a second4Simple representation of a time interval of a minute2Simple representation of a time interval of a hour1Simple representation of a time interval of a day2Simple representation of a time interval of a week3Simple representation of a time interval of a month2Simple representation of a time interval of a yearlThis provides the unified interface to herfed times. All instances of this class should obey the rule that if some interval you are adding is equivalent in another HerfAdd time then there should be no difference between adding that many to a HerfedTime i.e. (HerfMin 1) == (HerfSec 60) (herf $ add someTime (HerfMin 1) ) == (herf $ add someTime (HerfMin 60)) iThis defines the time language of herf the important rule here is path independence (unherf $ (herf a)   i ) == (a   i)RThis ensures that regardless of how you get to a time the result will be the sameSomething to notice is that rule still allows for lossy Time Stamps. The loss just has to be captured uniformally in the transforms and the interval arithmetic6come back from the UTCHerfTime universal represenationThe # is necessary to have an interface lifted5 so that all the functions can be abstracted over it^Below are the classes that make up the core of the HerfTime Library. Starting with the type B which is the encoding that most other time stamps pass through"Add Intervals of different amountsGdate 2016 01 01 `add` hour 3 `add` week 16 `add` month 3 :: UTCHerfTime#UTCHerfTime 2016-07-22 03:00:00 UTC&Represent Time in a few different waysZdateTime 2016 01 01 01 23 01 `add` (hour 3) `add` (week 16) `add` (month 3) :: UTCHerfTime#UTCHerfTime 2016-07-22 04:23:01 UTCadateTimePico 2016 01 01 01 23 01 01 `add` (hour 3) `add` (week 16) `add` (month 3) :: UTCHerfTime0UTCHerfTime 2016-07-22 04:23:01.000000000001 UTCUse negative signs to subtractPdate 2016 01 01 `add` hour (-3) `add` week (-16) `add` month (-3) :: UTCHerfTime#UTCHerfTime 2015-06-10 21:00:00 UTC%Interface functions following Kerf ymwdh i!s"p#)Display herf times in a pre formatted way3date 1 1 1 :: UTCHerfTime#UTCHerfTime 0001-01-01 00:00:00 UTC4eTime only, you can't just add a diff time to a date so we get a diff time back >>> time 1 1 1 3661s$$ is not part of a typeclass, just more sugar to make dealing with time conversion If both classes are defined on the same type, the classes should round trip. e.g. (date y m d ):: UTCTime in d == (reherf d))%getYear someUtcTime -> 2016y&getMonth someUtcTime -> 10m'getDay someUtcTime -> 31d(Get all date parts together)getHour someUtcTime -> 1h*getMin someUtcTime -> 37i+getSeconds someUtcTime -> 1s, getPicoseconds somUTCTime -> 1ps5OGet Times in any viable format (UTC for example) >>> unherf $ date 2016 01 01   hour 3   week 16  . month 3 :: UTCTime 2016-07-22 03:00:00 UTC6;UTCTime is the underlying and most important HerfTime thing7<NominalHerf time will obey the laws of HerfedTime by defaultI89:;<=>? @ !"#34ABC$%&'()*+,5D6EF7GHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~  !"#$%&'()*+,-#$%&'()*+,   !"289:;<=>? @ !"#34ABC$%&'()*+,5D6EF7GHIJKLMN*LocalTime interpreter for HerfedTime ClassPlow Technologies LLC MIT License Scott MurphyNone(>CN-EZoned Time always has an extra parameter to convert into a fixed time.Add Time Zone is different than converting It takes a UTCTime and just slaps on the timezone in the ZonedTime field This is exactly what you want when you are first creating a time and almost never what you want after!/4Helper function to convert UTCTime to HerfZoned time0*Getting back from HerfZonedTime to UTCTime11Don't want an orphan on ZonedTime so I made herfz2like $E but for zoned time (which doesn't have a direct HerfedTime instance):set -XDataKindsX(reherf $ ( dateTime 2016 01 01 01 01 01 :: HerfZonedTime "CST")) :: HerfZonedTime "PST"2015-12-31T23:01:01:PST -./012OPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~  !"#$%&'()*+,-./012-/0.12 -./012      !"#$%&'()*+,-./0123456789:  ;<=>?@ABCDEFGHIJKIJLIJMINOINPINQINRINSINTINUINVINWIXYIXZIX[IX\IX]IX^IX_IX`IXaIXbIXcIXdIXdIefIegIehIeiIejIekIelIemIenIeoIepIepIeqIerIesIesItuItvItwItxItyItzIt{It|It}It~ItItItItIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII0herft_LSalefUyAazKoqe6TY3dc8HerfTimeHerfTime.ZonedTimeHerfPicoHerfSecHerfMinHerfHourHerfDayHerfWeek HerfMonthHerfYearHerfAddadd HerfedTimeaddYearaddMonthaddWeekaddDayaddHour addMinute addSecond addPicoseconddatedateTime dateTimePicoFromUTCHerfTimeunherf ToUTCHerfTimeherf UTCHerfTimeyearmonthweekdayhourminutesecondpicoherfShowreherfgetYeargetMonthgetDay getDatePartsgetHourgetMin getSecondsgetPicoseconds HerfZonedTime addTimeZone toZonedTime fromZonedTimeherfzreherfzdateHerftime$fHerfedTimeUTCTime$fToUTCHerfTimeUTCTime$fToUTCHerfTimeUTCHerfTimetimePico dateTimeHerfdateTimePicoHerf$fFromUTCHerfTimeUTCTime$fHerfedTimeUTCHerfTime$fFromUTCHerfTimeUTCHerfTime$fHerfAddHerfPico$fHerfAddHerfSec$fHerfAddHerfMin$fHerfAddHerfHour$fHerfAddHerfDay$fHerfAddHerfWeek$fHerfAddHerfMonth$fHerfAddHerfYeartime_AXTdBF9VRQoBOqJT6qtmVHData.Time.Format formatTimeformatCharacter FormatTimeData.Time.Format.Parse readsTimereadTime parseTime readPTime readSTimeparseTimeOrError parseTimeM buildTime ParseTimeData.Time.Format.Localerfc822DateFormatiso8601DateFormatdefaultTimeLocaleknownTimeZones time12FmttimeFmtdateFmt dateTimeFmtamPmmonthswDays TimeLocaleData.Time.LocalTime.LocalTimeutcToLocalZonedTime getZonedTimezonedTimeToUTCutcToZonedTimelocalTimeToUT1ut1ToLocalTimelocalTimeToUTCutcToLocalTimelocalTimeOfDaylocalDay LocalTime zonedTimeZonezonedTimeToLocalTime ZonedTimeData.Time.LocalTime.TimeOfDaytimeOfDayToDayFractiondayFractionToTimeOfDaytimeOfDayToTimetimeToTimeOfDaylocalToUTCTimeOfDayutcToLocalTimeOfDaymakeTimeOfDayValidmiddaymidnighttodSectodMintodHour TimeOfDayData.Time.LocalTime.TimeZonegetCurrentTimeZone getTimeZoneutctimeZoneOffsetStringtimeZoneOffsetString'hoursToTimeZoneminutesToTimeZone timeZoneNametimeZoneSummerOnlytimeZoneMinutesTimeZoneData.Time.ClockgetCurrentTimeData.Time.Clock.UTCDiff diffUTCTime addUTCTimeData.Time.Clock.UTC utctDayTimeutctDayUTCTimeNominalDiffTimeData.Time.Calendar.GregorianaddGregorianYearsRollOveraddGregorianYearsClipaddGregorianMonthsRollOveraddGregorianMonthsClipgregorianMonthLength showGregorianfromGregorianValid fromGregorian toGregorianData.Time.Calendar.OrdinalDate isLeapYearData.Time.Calendar.DaysdiffDaysaddDaystoModifiedJulianDayModifiedJulianDayDayData.Time.Calendar.PrivateNumericPadOptionData.Time.Clock.ScalepicosecondsToDiffTimesecondsToDiffTimegetModJulianDate ModJulianDate UniversalTimeDiffTime$fHerfedTimeHerfZonedTime_unherfZonedTime$fFromUTCHerfTimeHerfZonedTime$fToUTCHerfTimeHerfZonedTime$fShowHerfZonedTime