Module Js.Types
Utility functions for runtime reflection on JS types
ocaml
type symbolreasonml
type symbol;Js symbol type only available in ES6
ocaml
type bigint_valreasonml
type bigint_val;Js bigint type only available in ES2020
ocaml
type obj_valreasonml
type obj_val;ocaml
type undefined_valreasonml
type undefined_val;This type has only one value undefined
ocaml
type null_valreasonml
type null_val;This type has only one value null
ocaml
type function_valreasonml
type function_val;ocaml
type _ t =
| Undefined : undefined_val t
| Null : null_val t
| Boolean : bool t
| Number : float t
| String : string t
| Function : function_val t
| Object : obj_val t
| Symbol : symbol t
| BigInt : bigint_val treasonml
type t(_) =
| Undefined : t(undefined_val)
| Null : t(null_val)
| Boolean : t(bool)
| Number : t(float)
| String : t(string)
| Function : t(function_val)
| Object : t(obj_val)
| Symbol : t(symbol)
| BigInt : t(bigint_val)
;ocaml
val test : 'a -> 'b t -> boolreasonml
let test: 'a => t('b) => bool;ocaml
test "x" String = truereasonml
test("x", String) == true;ocaml
type tagged_t =
| JSFalse
| JSTrue
| JSNull
| JSUndefined
| JSNumber of float
| JSString of string
| JSFunction of function_val
| JSObject of obj_val
| JSSymbol of symbol
| JSBigInt of bigint_valreasonml
type tagged_t =
| JSFalse
| JSTrue
| JSNull
| JSUndefined
| JSNumber(float)
| JSString(string)
| JSFunction(function_val)
| JSObject(obj_val)
| JSSymbol(symbol)
| JSBigInt(bigint_val)
;ocaml
val classify : 'a -> tagged_treasonml
let classify: 'a => tagged_t;