19 Sep
2002
19 Sep
'02
12:28 p.m.
Ross Paterson <ross@soi.city.ac.uk> wrote,
On Thu, Sep 19, 2002 at 12:03:34AM +1000, Manuel M T Chakravarty wrote:
RC 7 of the FFI Addendum is now available from
Must it include unsafePerformIO?
Sometimes you have a C function that is pure (and hence, you want to give it a pure type), but as C cannot return complex structures as a function result, you need to allocate a piece of memory, pass a pointer to the C function, and read the result out of that memory area on return of the C function. All this marshaling business requires IO actions; however, it doesn't change the pureness of the overall function. So, you typically want to unsafePerformIO the marshaling business. Cheers, Manuel