Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data FFI m = FFI {
- ffi_moduleName :: ModuleName
- ffi_values :: [ForeignImport m]
- data ForeignImport m = ForeignImport {}
- toEnv :: FFI m -> Env m
- toExterns :: FFI m -> ExternsFile
Foreign function interface
Describes a module which is implemented in Haskell, and made available to PureScript code using its foreign function interface.
Right now, this consists only of foreign value declarations, even though the FFI supports other forms of interop.
Values of this type can be constructed directly, but in many cases it is simpler to use the Dovetail.FFI.Builder module instead.
Values of this type can be consumed by the toExterns
and toEnv
functions,
and their results passed to the PureScript APIs or the low-level functions in
Dovetail.Evaluate and Dovetail.Build,
directly, but it is more likely that you will use values of this type with the
higher-level ffi
function.
FFI | |
|
toEnv :: FFI m -> Env m Source #
Convert a foreign module into an evaluation environment.
For advanced use cases, the result may be used with the functions in the Dovetail.Evaluate module.
toExterns :: FFI m -> ExternsFile Source #
Convert a foreign module into a PureScript externs file, for use during separate compilation.
For advanced use cases, the result may be used with the functions in the Dovetail.Build module.