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 =reasonml
type t(_) =ocaml
| Undefined : undefined_val treasonml
| Undefined : t(undefined_val)ocaml
| Null : null_val treasonml
| Null : t(null_val)ocaml
| Boolean : bool treasonml
| Boolean : t(bool)ocaml
| Number : float treasonml
| Number : t(float)ocaml
| String : string treasonml
| String : t(string)ocaml
| Function : function_val treasonml
| Function : t(function_val)ocaml
| Object : obj_val treasonml
| Object : t(obj_val)ocaml
| Symbol : symbol treasonml
| Symbol : t(symbol)ocaml
| BigInt : bigint_val treasonml
| BigInt : t(bigint_val)ocaml
reasonml
;ocaml
val test : 'a -> 'b t -> boolreasonml
let test: 'a => t('b) => bool;ocaml
test "x" String = truereasonml
test("x", String) == true;type tagged_t =| JSFalse| JSTrue| JSNull| JSUndefinedocaml
| JSNumber of floatreasonml
| JSNumber(float)ocaml
| JSString of stringreasonml
| JSString(string)ocaml
| JSFunction of function_valreasonml
| JSFunction(function_val)ocaml
| JSObject of obj_valreasonml
| JSObject(obj_val)ocaml
| JSSymbol of symbolreasonml
| JSSymbol(symbol)ocaml
| JSBigInt of bigint_valreasonml
| JSBigInt(bigint_val)ocaml
reasonml
;ocaml
val classify : 'a -> tagged_treasonml
let classify: 'a => tagged_t;