úÎ;’5Ky      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxNoneIiThis 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 same¢Something 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 arithmetic The  # 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-date 1 1 1 :: UTCHerfTime#UTCHerfTime 0001-01-01 00:00:00 UTC.eTime only, you can't just add a diff time to a date so we get a diff time back >>> time 1 1 1 3661s22Ò 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))3getYear someUtcTime -> 2016y4getMonth someUtcTime -> 10m5getDay someUtcTime -> 31d6Get all date parts together7getHour someUtcTime -> 1h8getMin someUtcTime -> 37i9getSeconds someUtcTime -> 1s;OGet 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 UTC=;UTCTime is the underlying and most important HerfTime thing@<NominalHerf time will obey the laws of HerfedTime by defaultI  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGH;  !"#$%&'()*+,-./0123456789:I$%&'()*+,-./01"# !2HGFEDCBA  @?>=<;3456789:2     !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGH*LocalTime interpreter for HerfedTime ClassPlow Technologies LLC MIT License Scott MurphyNone,DITmEZoned Time always has an extra parameter to convert into a fixed timenÝ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!q1Don't want an orphan on ZonedTime so I made herfzs:set -XDataKindsX(reherf $ ( dateTime 2016 01 01 01 01 01 :: HerfZonedTime "CST")) :: HerfZonedTime "PST"2015-12-31T23:01:01:PST myznopqrstuvmnopqrmopnqr myznopqrstuv{        !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrgst&herf-time-0.2.0-6JR0y04SlYBLEiC1PiHuysHerfTimeHerfTime.ZonedTimeHerfPicoHerfSecHerfHourHerfMinHerfDayHerfWeek HerfMonthHerfYearHerfAddadd HerfedTimeaddYearaddMonthaddWeekaddDayaddHour addMinute addSecond addPicoseconddatedateTime dateTimePicoFromUTCHerfTimeunherf ToUTCHerfTimeherf UTCHerfTimeyearmonthweekdayhourminutesecondpicoherfShowdateHerftimetimePico dateTimeHerfdateTimePicoHerfreherfgetYeargetMonthgetDay getDatePartsgetHourgetMin getSecondsgetPicoseconds$fHerfedTimeUTCTime$fFromUTCHerfTimeUTCTime$fToUTCHerfTimeUTCTime$fHerfedTimeUTCHerfTime$fFromUTCHerfTimeUTCHerfTime$fToUTCHerfTimeUTCHerfTime$fHerfAddHerfPico$fHerfAddHerfSec$fHerfAddHerfMin$fHerfAddHerfHour$fHerfAddHerfDay$fHerfAddHerfWeek$fHerfAddHerfMonth$fHerfAddHerfYear$fEqUTCHerfTime$fOrdUTCHerfTime$fShowUTCHerfTime$fFormatTimeUTCHerfTime $fNumHerfYear $fEqHerfYear $fOrdHerfYear$fShowHerfYear$fNumHerfMonth $fEqHerfMonth$fOrdHerfMonth$fShowHerfMonth $fNumHerfWeek $fEqHerfWeek $fOrdHerfWeek$fShowHerfWeek $fNumHerfDay $fEqHerfDay $fOrdHerfDay $fShowHerfDay $fNumHerfMin $fEqHerfMin $fOrdHerfMin $fShowHerfMin $fNumHerfHour $fEqHerfHour $fOrdHerfHour$fShowHerfHour $fNumHerfSec $fEqHerfSec $fOrdHerfSec $fShowHerfSec $fNumHerfPico $fEqHerfPico $fOrdHerfPico$fShowHerfPico HerfZonedTime addTimeZone toZonedTime fromZonedTimeherfzreherfz$fHerfedTimeHerfZonedTime$fFromUTCHerfTimeHerfZonedTime$fToUTCHerfTimeHerfZonedTime$fShowHerfZonedTime$fFormatTimeHerfZonedTime$fParseTimeHerfZonedTime_unherfZonedTime