[Haskell-cafe] allocation for "pure" FFI functions

Edward Z. Yang ezyang at MIT.EDU
Thu Oct 14 14:01:38 EDT 2010


Excerpts from Johannes Waldmann's message of Thu Oct 14 13:45:46 -0400 2010:
> Is there a solution? Workaround? Better approach?
> If it boils down to unsafePerformIO, then where do I put it,
> and what should I watch out for?

unsafePerformIO is your ticket here. The key is to ensure all
of the usual purity contracts are fulfilled by the composition
of IO operations you are shoving into the pure world.

I did a presentation on this for one particular FFI library: check the second
half of the slide deck.

    http://web.mit.edu/~ezyang/Public/galois.pdf

Cheers,
Edward


More information about the Haskell-Cafe mailing list