Module Js.Types

Utility functions for runtime reflection on JS types

type symbol;

Js symbol type only available in ES6

type bigint_val;

Js bigint type only available in ES2020

type obj_val;
type undefined_val;

This type has only one value undefined

type null_val;

This type has only one value null

type function_val;
type t(_) =
  1. | Undefined : t(undefined_val)
  2. | Null : t(null_val)
  3. | Boolean : t(bool)
  4. | Number : t(float)
  5. | String : t(string)
  6. | Function : t(function_val)
  7. | Object : t(obj_val)
  8. | Symbol : t(symbol)
  9. | BigInt : t(bigint_val)
;
let test: 'a => t('b) => bool;
test "x" String = true
type tagged_t =
  1. | JSFalse
  2. | JSTrue
  3. | JSNull
  4. | JSUndefined
  5. | JSNumber(float)
  6. | JSString(string)
  7. | JSFunction(function_val)
  8. | JSObject(obj_val)
  9. | JSSymbol(symbol)
  10. | JSBigInt(bigint_val)
;
let classify: 'a => tagged_t;