Time library design proposal

Ashley Yakeley ashley at semantic.org
Tue Feb 1 22:15:56 EST 2005


In article <87k6prrgb2.fsf at qrnik.zagroda>,
 Marcin 'Qrczak' Kowalczyk <qrczak at knm.org.pl> wrote:

> > There are also lots of contexts where you want a time but not a date
> > e.g. an alarm clock....
> 
> 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. Someone might do something similiar in Haskell like 
this:

  data IncompleteDateTime = MkIncompleteDateTime
    incYear :: Maybe Int
    incMonth :: Maybe Int
    incDay :: Maybe Int
    incHour :: Maybe Int
    ...

An interesting idea, but probably not useful enough to put in a standard 
library.

-- 
Ashley Yakeley, Seattle WA



More information about the Libraries mailing list