dovetail-0.1.0.0
Safe HaskellNone
LanguageHaskell2010

Dovetail.FFI

Synopsis

Foreign function interface

data FFI m Source #

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.

Constructors

FFI 

Fields

data ForeignImport m Source #

A single value implemented in a foreign Haskell module.

Constructors

ForeignImport 

Fields

  • fv_name :: Ident

    The name of this value in PureScript code

  • fv_type :: SourceType

    The PureScript type of this value

  • fv_value :: Value m

    The value itself

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.