March 2019 # Haskell - Foreign Function Interface Haskell's FFI allows easily to cooperate with other languages. Foreign functions can call Haskell code and vice versa. Simple examples can be found in my git repository [1]. For now, the provided Makefile exposes two interesting targets: * **c\_from\_hask** - simple program with a C function called from Haskell. * **hask\_from\_c** - simple programm with a Haskell function called from C. The next step is to pass more complicated structures via _ForeignPtr_'s. ## Notes * since version 8.4 GHC guarantees that garbage collection will never occur during an unsafe call. ## Ref * [1] * [2] * [3]