Js
This library provides bindings and necessary support for JS FFI. It contains all bindings into Js
namespace.
[| 1;2;3;4|]
|. Js.Array2.map (fun x -> x + 1 )
|. Js.Array2.reduce (+) 0
|. Js.log
module Fn: { ... };
The same as isNullable
except that it is more permissive on the types of input
The same as empty
in Js.Null
will be compiled as null
The same as empty
Js.Undefined
will be compiled as undefined
typeof x
will be compiled as typeof x
in JS Please consider functions in Types
for a type safe way of reflection
unsafe_lt a b
will be compiled as a < b
. It is marked as unsafe, since it is impossible to give a proper semantics for comparision which applies to any type
unsafe_le a b
will be compiled as a <= b
. See also unsafe_lt
unsafe_gt a b
will be compiled as a > b
. See also unsafe_lt
unsafe_ge a b
will be compiled as a >= b
. See also unsafe_lt
Types for JS objects
A value of this type can be either null
or 'a
. This type is the same as type t
in Null
A value of this type can be either undefined
or 'a
. This type is the same as type t
in Undefined
A value of this type can be undefined
, null
or 'a
. This type is the same as type t
n Nullable
module Exn: { ... };
Provide utilities for dealing with Js exceptions
module String: { ... };
Provide bindings to JS string
module Null: { ... };
Provide utilities around 'a null
module Nullable: { ... };
Provide utilities around null_undefined
module Array: { ... };
Provide bindings to Js array
module Re: { ... };
Provide bindings to Js regex expression
module Promise: { ... };
Provide bindings to JS promise
module Date: { ... };
Provide bindings for JS Date
module Dict: { ... };
Provide utilities for JS dictionary object
module Global: { ... };
Provide bindings to JS global functions in global namespace
module Json: { ... };
Provide utilities for json
module Math: { ... };
Provide bindings for JS Math
object
module Obj: { ... };
module Typed_array: { ... };
Provide bindings for JS typed array
module Types: { ... };
Provide utilities for manipulating JS types
module Float: { ... };
Provide utilities for JS float
module Int: { ... };
Provide utilities for int
module Bigint: { ... };
Provide utilities for bigint
module Console: { ... };
module Set: { ... };
Provides bindings for ES6 Set
module WeakSet: { ... };
Provides bindings for ES6 WeakSet
module Map: { ... };
Provides bindings for ES6 Map
module WeakMap: { ... };
Provides bindings for ES6 WeakMap