fay-0.24.2.0: A compiler for Fay, a Haskell subset that compiles to JavaScript.
Safe HaskellNone
LanguageHaskell2010

Fay.FFI

Description

The internal FFI module.

Synopsis

Documentation

data Fay a Source #

The JavaScript FFI interfacing monad.

Instances

Instances details
Monad Fay Source # 
Instance details

Defined in Fay.Types

Methods

(>>=) :: Fay a -> (a -> Fay b) -> Fay b #

(>>) :: Fay a -> Fay b -> Fay b #

return :: a -> Fay a #

Functor Fay Source # 
Instance details

Defined in Fay.Types

Methods

fmap :: (a -> b) -> Fay a -> Fay b #

(<$) :: a -> Fay b -> Fay a #

Applicative Fay Source # 
Instance details

Defined in Fay.Types

Methods

pure :: a -> Fay a #

(<*>) :: Fay (a -> b) -> Fay a -> Fay b #

liftA2 :: (a -> b -> c) -> Fay a -> Fay b -> Fay c #

(*>) :: Fay a -> Fay b -> Fay b #

(<*) :: Fay a -> Fay b -> Fay a #

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 = a Source #

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 = a Source #

The opposite of Ptr. Serialize the specified polymorphic type.

foo :: Automatic a -> String

ffi Source #

Arguments

:: IsString s 
=> s

The foreign value.

-> a

Bottom.

Declare a foreign action.