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

Jason Dusek jason.dusek at
Thu Mar 28 16:49:02 CET 2013

2013/3/28 David Virebayre <dav.vire+haskell at>:
> 2013/3/28 Jason Dusek <jason.dusek at>
>> 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).
> I agree that the latter perspective seems more appropriate,
> however, according to Wikipedia :
> ISO C defines time_t as an arithmetic type, but does not
> specify any particular type, range, resolution, or encoding
> for it. Also unspecified are the meanings of arithmetic
> operations applied to time values.
> So, even if, in C, you may be able to apply arithmetic
> operations to a time_t, you can't be sure it makes sense, so
> you shouldn't normally do it. Why then, make it easier in
> Foreign.C to do something meaningless ? That's just begging to
> shoot yourself in the foot.

Working with C will always involve a lot of easy ways to shoot
off a foot or two. Why introduce ob/abstractions that can't
really move the needle, since C is so basically unsafe?

Jason Dusek
pgp // solidsnack // C1EBC57DC55144F35460C8DF1FD4C6C1FED18A2B

More information about the Libraries mailing list