fay-0.4.0.4: A compiler for Fay, a Haskell subset that compiles to JavaScript.

Safe HaskellSafe-Infered

Language.Fay.FFI

Synopsis

Documentation

data JsPtr a Source

Instances

Foreign (JsPtr a)

Pointers to arbitrary objects are OK.

class Foreign a Source

Contains allowed foreign function types.

Instances

Foreign Bool

Bools are OK.

Foreign Char

Characters are OK.

Foreign Double

All numbers in JS are double.

Foreign ()

Unit is OK.

Foreign a => Foreign [a]

Lists → arrays are OK.

Foreign a => Foreign (Fay a)

JS values are foreignable.

Foreign (JsPtr a)

Pointers to arbitrary objects are OK.

(Foreign a, Foreign b) => Foreign (a -> b)

Functions are foreignable.

ffiSource

Arguments

:: Foreign a 
=> String

The foreign value.

-> FayReturnType

JS return type (if any).

-> a

Bottom.

Declare a foreign action.