To enable FFI support in GHC, give the -fffiflag, or
the -fglasgow-exts flag which implies -fffi
.

The FFI support in GHC diverges from the Addendum in the following ways:

Syntactic forms and library functions proposed in earlier versions
of the FFI are still supported for backwards compatibility.

GHC implements a number of GHC-specific extensions to the FFI
Addendum. These extensions are described in Section 8.1, “GHC extensions to the FFI Addendum”, but please note that programs using
these features are not portable. Hence, these features should be
avoided where possible.

The FFI libraries are documented in the accompanying library
documentation; see for example the Foreign
module.

8.1. GHC extensions to the FFI Addendum

The FFI features that are described in this section are specific to
GHC. Avoid them where possible to not compromise the portability of the
resulting code.