Michael Weber wrote:
[...] otherwise there would be a `marshalList' and `marshalListN' with
same type signature, which I also regarded as confusing.
That was a problem with your approach, not mine... :-)
[...] But how else can you marshall an arbitrary length list? For
Int lists, there
On Wed, Oct 06, 1999 at 12:04:03 +0200, Sven Panne wrote:
Michael Weber wrote:
marshalListN :: Int - [a] - IO Addr
I don't see a reason for the duplication of length information, e.g.
what should `marshalListN 1000 [1,2,3]' mean? And
`marshalListN 2 [1,2,3]' is equivalent to
Michael Weber wrote:
Maybe it's worth to know how many objects a list has (without explicit
zeroElem), so I'd suggest to extend the class to:
marshalList ::[a] - IO Addr
We agree here.
marshalListN :: Int - [a] - IO Addr
I don't see a reason for the duplication
GHC's Addr module is meant to be used in conjunction with the FFI (at
least this is what the docs told me :-), but its plethora of similar
functions is not very nice and some often needed functionality is
missing. Attached is my proposed new version of Addr, being very
similar to the things in