The Foreign Function Interface (FFI) consists of three parts:
foreign import and export declarations (defined in an extra
document A Haskell Foreign Function Interface), a language-
independent marshalling library (whose interface is provided by
the present module), and a language-dependent marshalling
library (see Section 4.6). The language-independent portion of
the marshalling library, whose entire interface is provided by
the module Foreign, consists of the following modules: Int
(Section 4.18), Word (Section 4.38), Ptr (Section 4.29),
ForeignPtr (Section 4.15), StablePtr (Section 4.34), Storable
(Section 4.35), MarshalAlloc (Section 4.22), MarshalArray
(Section 4.23), MarshalError (Section 4.24), and MarshalUtils
(Section 4.25). The language-dependent portion of the
marshalling library is currently only available for the language
C, and is essentially intended to support writing portable
Haskell bindings to C libraries. All C-dependent functionality
can be obtained from the module CForeign (Section 4.6).