moduleData.Time.Convenience(timeFor,timeSince,moduleData.Time.Convenience.Data)whereimportData.Time.ClockimportControl.Applicative((<$>))importData.Time.Convenience.DataimportData.Time.Convenience.Calculators-- | Produce the time following the specified offset. For example, to get-- the date and time from two weeks from right now:---- > timeFor 1 Fortnight FromNowtimeFor::NominalDiffTime->Unit->Direction->IOUTCTimetimeFornunitdirection=docurrentTime<-getCurrentTimereturn$timeSincecurrentTimenunitdirection-- | Given a time, produce a new time offset from that time. For example,-- to get the date and time from a month after two weeks ago:---- > do-- > twoWeeksAgo <- timeFor 1 Fortnight Ago-- > return $ timeSince twoWeeksAgo 1 Month FromThattimeSince::UTCTime->NominalDiffTime->Unit->Direction->UTCTimetimeSincebasenunitdirection=addUTCTime((calculatorunit)ndirection)base-- | Given a Unit, produce the function that takes a number and a direction and-- produces the number of seconds to offset the current time.calculator::(Numi)=>Unit->(i->Direction->i)calculatorSecond=secondscalculatorSeconds=secondscalculatorMinute=minutescalculatorMinutes=minutescalculatorHour=hourscalculatorHours=hourscalculatorDay=dayscalculatorDays=dayscalculatorWeek=weekscalculatorWeeks=weekscalculatorFortnight=fortnightscalculatorFortnights=fortnights