Simon Marlow simonmar at microsoft.com
Tue Jan 25 09:24:39 EST 2005

On 22 January 2005 07:14, Ashley Yakeley wrote:

> There's been a lot of discussion here and other lists of replacing
> System.Time, and indeed Simon M. is working on a replacement proposal:
>   <http://www.haskell.org/~simonmar/time/NewTime.html>
>   <http://www.haskell.org/~simonmar/time/NewTime.hsc>
> Rather than talk about specific Haskell code, I'd like to discuss the
> measurement of time in general, how these concepts might be expressed
> in Haskell, and what people might want from a time library. Rather
> than propose anything, I want to try to ask some of the right
> questions. 

I'd like to join the others in saying thanks for a fine summary, Ashley.
Nice work!

On the subject of the NewTime library you mentioned, it was the
culmination of a long thread (or threads) on this list a while ago.  I
think it's a pretty good stab at an API for manipulating and converting

  - absolute time (TAI)
  - UTC
  - times in calendar representation
  - timezones

but it is missing

  - time offsets (eg. "1 day later")
  - a more complete/accurate timezone table
  - some way to update the leap second table
  - geographical time zones

and probably some other things.

my plan was that the whole "time offset" issue would be a layer on top
of this library, as others have suggested.  You can already do simple
calculations using CalendarTime.

The representation of absolute time could be revisited.

What I mean by "geographical time zones" is some notion of a time zone
that is independent of daylight savings time.  The current TimeZone type
is a fixed UTC offset (which I think is right), but there's no way to
say "what's the local time in London at time T?".

I probably won't be doing much to this library, but I think it's a good
starting point for anyone who wants to explore further.


More information about the Libraries mailing list