corsis / clock

High-resolution clock functions: monotonic, realtime, cputime.
Other
58 stars 25 forks source link

"Seconds" RealFrac instance #68

Closed Mathnerd314 closed 3 years ago

Mathnerd314 commented 3 years ago

So my PR #67 makes the Num instance consistent in the following way:

IMO this is the simpler and more useful approach. But there is another Num instance defined in the style of Fixed in the following way:

I wrote this as a wrapper newtype Seconds here in this PR. The behavior is chosen to be similar to Float/Double, so #49 should be solved by using this newtype instead of TimeSpec.

The name "Seconds" is inspired by extra, I don't know if it's really a good name for it.