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

Brandon Allbery allbery.b at gmail.com
Thu Mar 28 22:20:17 CET 2013


On Thu, Mar 28, 2013 at 5:11 PM, Henning Thielemann <
lemming at henning-thielemann.de> wrote:

> On Thu, 28 Mar 2013, Brandon Allbery wrote:
>
>> If CTime is only for interfacing with C, then there should not be any
>> arithmetic or bit manipulation
>> class instances of it, only some conversion functions between CTime and
>> Haskell time representations.
>>
>> ...and implementing those should be as painful as possible?
>>
>
> Implementing these conversion functions means unpacking data from the
> CTime constructor and convert it to Haskell time representations or vice
> versa. I don't think it is possible to write conversion functions using Num
> and Bits that work on all architectures. If there is functionality that can
> be used on multiple architectures this should be provided as helper
> functions.
>

Can't be done on all architectures, therefore we should ensure it can't be
done at all. Which means CTime can never actually be used from Haskell, not
even by converting it to a Haskell-friendly representation, but only as an
opaque blob; that's really helpful when interfacing to e.g. POSIX functions.

-- 
brandon s allbery kf8nh                               sine nomine associates
allbery.b at gmail.com                                  ballbery at sinenomine.net
unix, openafs, kerberos, infrastructure, xmonad        http://sinenomine.net
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/libraries/attachments/20130328/160e1179/attachment.htm>


More information about the Libraries mailing list