Js
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
val toOption : 'a nullable -> 'a option
val undefinedToOption : 'a undefined -> 'a option
val nullToOption : 'a null -> 'a option
val isNullable : 'a nullable -> bool
The same as isNullable
except that it is more permissive on the types of input
val undefined : 'a undefined
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
val eqNull : 'a -> 'a null -> bool
val eqUndefined : 'a -> 'a undefined -> bool
val eqNullable : 'a -> 'a nullable -> bool
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
module Exn : sig ... end
Utilities for dealing with Js exceptions
module String : sig ... end
Bindings to the functions in String.prototype
module Array : sig ... end
Bindings to the functions in Array.prototype
module Re : sig ... end
Bindings to the functions in RegExp.prototype
module Promise : sig ... end
Bindings to JS Promise
functions
module Date : sig ... end
Bindings to the functions in JS's Date.prototype
module Dict : sig ... end
Utility functions to treat a JS object as a dictionary
module Global : sig ... end
Bindings to functions in the JS global namespace
module Json : sig ... end
Utility functions to manipulate JSON values
module Math : sig ... end
Bindings to the functions in the Math
object
module Obj : sig ... end
Utility functions on `Js.t` JS objects
module Typed_array : sig ... end
Bindings to the functions in TypedArray.prototype
module Types : sig ... end
Utility functions for runtime reflection on JS types
module Float : sig ... end
Bindings to functions in JavaScript's Number
that deal with floats
module Int : sig ... end
Bindings to functions in JavaScript's Number
that deal with ints
module Bigint : sig ... end
Bindings to functions in JavaScript's BigInt
module Console : sig ... end
module Set : sig ... end
Bindings to functions in Set
module WeakSet : sig ... end
Bindings to functions in WeakSet
module Map : sig ... end
Bindings to functions in Map
module WeakMap : sig ... end
Bindings to functions in WeakMap
module Iterator : sig ... end
Bindings to functions on Iterator