The numeric c types are (effectively) integral, too.

Jason Dusek jason.dusek at
Thu Mar 28 11:32:37 CET 2013

2013/3/27 Henning Thielemann <lemming at>:
> 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

More information about the Libraries mailing list