
28 Mar
2013
28 Mar
'13
6:32 a.m.
2013/3/27 Henning Thielemann
Writing orphan instances is generally a bad idea. Instead you could put your roundTo function into a nice package and import it everywhere. I don't think that an Integral instance is the right way to go, since it would imply the signature:
div :: CTime -> CTime -> CTime
and the quotient of two time values is not a time.
One way to think of it is, CTime is time and should follow the rules of the time. Another way is, CTime is a C type and should follow the rules of C types. The latter perspective seems more appropriate for Foreign.C.* (we are likely to seek out some other module for modelling time). -- Jason Dusek pgp // solidsnack // C1EBC57DC55144F35460C8DF1FD4C6C1FED18A2B