> Can you achieve the same performance gain by adding some 
> rewrite rules?

Perhaps you could try to spot

        (>>=) malloc (\p -> newForeignPtr p free)

Hmmm.  Actually I'd like to do both: add the functions, because they
encapsulate a common case and guarantee a speed improvement if you use
them, and add the rewrite rule because it might catch some cases in
existing code.  The problem with relying on rewrite rules exclusively is
that they tend to be a bit fragile and can fail to trigger without you
noticing.

Cheers,
        Simon
_______________________________________________
FFI mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/ffi

Reply via email to