4 Sep 2000 14:22:52 GMT, Marcin 'Qrczak' Kowalczyk <[EMAIL PROTECTED]> pisze:
> > Perhaps this is too much complication given that the underlying
> > implementations are so similar, but it seems nice.
>
> Some functions would have to be overloaded (not polymorphic).
> Hopefully I will manage to just overload on Storable...
It was surprisingly easy, actually simplifying some parts, and fixing
about two errors which confused character and byte lengths :-)
Good that I have chosen character lengths even for C implementations,
unlike iconv.
So OK, conversions are now typed.
Functions are sometimes "unnecessarily" overloaded. For example an
internal function that converts either-Haskell-or-C-style-converter to
Haskell-style-converter is overloaded on character types, even though
in case it gets a Haskell style converter the constraint is not needed.
This overloading is then carried to other functions.
type Byte = Word8
It's not CChar so sometimes a pointer cast or fromIntegral is needed.
(Previously it was not better.)
BTW, some GHC's Int and Word details are inefficient, and some are wrong.
These modules really should be cleaned. Perhaps I will find time for it.
What about #ifdef __HUGS__ - is it to be removed?
--
__("< Marcin Kowalczyk * [EMAIL PROTECTED] http://qrczak.ids.net.pl/
\__/
^^ SYGNATURA ZASTĘPCZA
QRCZAK