
On 2005 February 01 Tuesday 22:15, Ashley Yakeley wrote:
Marcin 'Qrczak' Kowalczyk
wrote: And there are contexts where you want a weekday and hour/minute but not a month or second (a weekly schedule), contexts where you want month/day but not a year (a holiday with a fixed date) etc. Where to stop?
Perl's DateTime has an "Incomplete" class for representing incompletely specified times.
newtype AbsPicoseconds = AbsPicoseconds Integer newtype AbsSeconds = AbsSeconds Integer newtype AbsDays = AbsDays Integer and more newtype AbsHours = AbsHours Integer newtype AbsMonths = AbsMonths Integer newtype AbsYears = AbsYears Integer
If there were types for various intervals of time, as Ben Rudiak-Gould wrote: then an incomplete time would amount to a function from a less precise time interval to a more precise time interval. Various types of incomplete time fall right out. This wouldn't handle the conversion between "local time", and time with a specified zone.