Re: Staying alive

1999-10-06 Thread Sven Panne
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

Re: Staying alive

1999-10-06 Thread Michael Weber
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

Re: Staying alive

1999-10-06 Thread Sven Panne
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

RFC: An extended Addr module

1999-10-06 Thread Sven Panne
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