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

Safe HaskellNone

Language.Fay.FFI

Description

The internal FFI module. Needs to be renamed to Fay.FFI at some point.

Synopsis

Documentation

data Fay a Source

The JavaScript FFI interfacing monad.

Instances

data Nullable a Source

Values that may be null Nullable x decodes to x, Null decodes to null.

Constructors

Nullable a 
Null 

data Defined a Source

Values that may be undefined Defined x encodes to x, Undefined decodes to undefined. An undefined property in a record will be removed when encoding.

Constructors

Defined a 
Undefined 

type Ptr a = aSource

Do not serialize the specified type. This is useful for, e.g.

 foo :: String -> String
 foo = ffi "%1"

This would normally serialize and unserialize the string, for no reason, in this case. Instead:

 foo :: Ptr String -> Ptr String

Will just give an identity function.

type Automatic a = aSource

The opposite of Ptr. Serialize the specified polymorphic type.

 foo :: Automatic a -> String

ffiSource

Arguments

:: String

The foreign value.

-> a

Bottom.

Declare a foreign action.