memory useage of data types in the time package

Evan Laforge qdunkan at
Fri May 21 15:48:58 EDT 2010

> One of the most common complaints heard about Haskell is that Data.Time
> is so much more difficult to use than the basic time API in most other
> languages. I believe that those complaints are totally unjustified. It's

Getting off the subject, but:

I think if the complaint is that it's hard because it doesn't have
much documentation, as it is for me, then the complaint is totally

Data.Time has no documentation, so right off you have to start
guessing about which module to use.  It took me a long time to figure
out that a plain yyyy/mm/dd is modeled as a Data.Time.Calendar.Day.
Or is it JulianDay?  What's an OrdinalDate?  MonthDay sounds promising
but defines no data types.  The haddock talks about Julian days and
"proleptic Gregorian calendars" and never quite gets around to
mentioning that this is not just for people wanting to calculate how
many days there are between now and the assassination of Julius
Caesar, but for anyone wanting to deal with a modern date.  Most
people, when looking for "a date" are not going to start looking for
things that say "julian day" on them.

After wading through all this stuff that has no explanation but by
function name sounds like it's for scholars of Christian antiquity,
the temptation to go back to System.Time, which provides only one
module and a totally straightforward pair of types, is really strong.
Especially when System.Time says "this is deprecated" but doesn't say
why.  It must have been written for a scholar of Christian antiquity
for other scholars of Christian antiquity who are disappointed that
System.Time lacks functions to find the Paschal full moon of the
Easter feast day of the Western Orthodox Catholic tradition as
standardized by Pope XXXIV but not put into effect until...

Say someone who understands Data.Time wrote some top level haddock and
some examples of how to create dates, create times, get the current
date and time, and find the number of months and days between now and
then along with some of the things to take into account, etc.  Perhaps
the majority of the complaints would be satisfied.  I don't know
enough about dates to write the intro, but I'd be happy to proofread

More information about the Libraries mailing list