This changes the signum function for TimeSpec to match the multiplication. Also Seconds is moved into a separate module, so that the various functions can be re-exported with Seconds type. I had to export normalize and s2ns but people doing complicated things with the TimeSpec type will probably need them.
I also extended the tests a lot, amazingly they all pass. They don't pass if you change arbitrarySizedIntegral to arbitrary, due to overflow errors. Maybe there should be a warning somewhere about the silent overflow behavior.
And I added a Bounded instance for TimeSpec / Seconds, hopefully it's correct.
This changes the
signum
function for TimeSpec to match the multiplication. AlsoSeconds
is moved into a separate module, so that the various functions can be re-exported withSeconds
type. I had to exportnormalize
ands2ns
but people doing complicated things with the TimeSpec type will probably need them.I also extended the tests a lot, amazingly they all pass. They don't pass if you change
arbitrarySizedIntegral
toarbitrary
, due to overflow errors. Maybe there should be a warning somewhere about the silent overflow behavior.And I added a Bounded instance for TimeSpec / Seconds, hopefully it's correct.