FFI imports packaging utility
- 1 Abstract
- 2 Benefits of Packaging FFI Imports
- 3 Purpose
- 4 Command Line Options
- 5 Creating a FFI Import Package
- 6 Examples
- 7 References
The Haskell Cabal  is a framework which defines a common interface for authors to more easily build their applications in a portable way. The Haskell Foreign Functions Import Generator (hsffig)  is a tool to convert a C header file (.h) into Haskell code containing FFI  import statements for all entities whose declarations are found in the header file. The FFI Packaging Utility (ffipkg) is a tool that integrates the functionality of hsffig with the Cabal framework allowing for building and installation of packages entirely consisting of foreign functions imports.
Benefits of Packaging FFI Imports
To build a Haskell application linked to a foreign library, it is necessary to specify the locations of certain files (C headers and static or shared library files) for the Haskell compiler, and this information must be remembered for every application using the library. Building a FFI package means that all such information is contained within the package descriptor, and all that needs to be remembered is just name of the package.