RE: Time library design proposal

[Oops, replied only to Ashley, not to list.]
From: Ashley Yakeley [mailto:ashley@semantic.org]
There's something to be said for representing date and time of day separately in calendar time, something like this:
data CalendarDate = CalendarDate ...
data TimeOfDay = TimeOfDay ...
data CalendarTime = CalendarTime { ctDate :: CalendarDate, ctTime :: TimeOfDay }
On the other hand, it adds two levels of construction to CalendarTime.
I'm not convinced. I think it would be simpler and just as functional to have just a CalendarTime and a Duration. You would represent a time by a Duration (i.e. time since midnight), and a day with no time component would be represented by that date at midnight. You could add a Duration to a CalendarTime to get a date-with-time. Durations have other uses (differences between two CalendarTimes, summing other Durations, etc), whereas a TimeOfDay is limited to a 24hr period. Alistair. ----------------------------------------- ***************************************************************** Confidentiality Note: The information contained in this message, and any attachments, may contain confidential and/or privileged material. It is intended solely for the person(s) or entity to which it is addressed. Any review, retransmission, dissemination, or taking of any action in reliance upon this information by persons or entities other than the intended recipient(s) is prohibited. If you received this in error, please contact the sender and delete the material from any computer. *****************************************************************
participants (1)
-
Bayley, Alistair