Let's get this finished

Sven Panne Sven.Panne at informatik.uni-muenchen.de
Sat Jan 6 07:28:46 EST 2001


"Manuel M. T. Chakravarty" wrote:
> [...] I see your point, however, personally, I still prefer to
> have overloading for the common cases (that what we want
> most of the time when given a particular type) and use
> explicit functions only for the exceptions.  That makes the
> resulting code more readable in my opinion - as it contains
> less clutter for the common case.  But I guess, this is a
> matter of personal style. [...]

In the case of CString/Ptr CChar it's not only that: Storable.sizeOf
should never use its argument, but it would have to in the case of
variable length C strings. And what should be the semantics of
{peek,poke}ElemOff here? In a nutshell: instance Storable CString
makes sense only partially, so I fear there is no other option than
using non-overloaded functions. Or we have to re-design Storable
somehow (alignment, peek, peekByte, poke, and pokeByte *do* make
sense for CString).

Cheers,
   Sven




More information about the FFI mailing list