The problem is that this type is rather useless.
E.g.:
you can't find the exact number of days this amounts to
you can't compare values of this type, only test equality
this type is undocumented
This type's only vaguely useful destructors are its fields ctMonths and ctTime, unfortunately ctMonths representing a number of months, one cannot find the duration it amounts to. CalendarDiffTime {ctMonths = 1, ctTime = fromInteger 0} has a different meaning (hence, duration value, hence number of days) between January and February vs between February and March.
How about switching to a more useful type, e.g. NominalDiffTime?
This type has many useful destructors, like Ord and Num instances (e.g. one can myNominalDiffTime / nominalDay to find the number of days).
Currently Rel8.Expr.Time treats durations (SQL type
interval
) as CalendarDiffTime.The problem is that this type is rather useless. E.g.:
This type's only vaguely useful destructors are its fields
ctMonths
andctTime
, unfortunatelyctMonths
representing a number of months, one cannot find the duration it amounts to.CalendarDiffTime {ctMonths = 1, ctTime = fromInteger 0}
has a different meaning (hence, duration value, hence number of days) between January and February vs between February and March.How about switching to a more useful type, e.g. NominalDiffTime? This type has many useful destructors, like
Ord
andNum
instances (e.g. one canmyNominalDiffTime / nominalDay
to find the number of days).