George
If you engage in discussion with other people (e.g. Fergus) who'd like
to contribute, come up with a revised specification, and
document and implement it, we'll gladly include it in the GHC distribution
(and
I expect the Hugs team will too).
We can't change "Time" though; it's a Haskell 98 module, and
we can't change Haskell 98. Since our module name space remains
flat, we'll have to find a different name. "Time2" perhaps?
One technical point:
| is an obvious logical solution to this. Make the two kinds
| of time difference
| have different types. Thus
| class TimeDiff a where
| addToClockTime :: a -> ClockTime -> ClockTime
| diffClockTimes :: ClockTime -> ClockTime -> a
I'd suggest *not* putting diffClockTimes in the class.
You'll get lots of ambiguities.
e.g. (a + (b - c))
what sort of "-" do you mean?
Better, I think, to say
diffMinutes
diffHours
diffMonths
diffDays
etc.
And once you have that, maybe they could all return the
same type (TimeDiff) and then the need for the class goes away.
diffMinutes :: ClockTime -> ClockTime -> TimeDiff
Simon