Types
Provide utilities for manipulating JS types.
symbol
Deprecated
type symbol = Symbol.tJs symbol type (only available in ES6)
obj_val
Deprecated
type obj_val = \"Type.Classify".objectundefined_val
Deprecated
This has been deprecated and will be removed in v13. Use functions and types from the Type module instead.
type undefined_valThis type has only one value undefined
null_val
Deprecated
This has been deprecated and will be removed in v13. Use functions and types from the Type module instead.
type null_valThis type has only one value null
function_val
Deprecated
type function_val = \"Type.Classify".functiont
Deprecated
This has been deprecated and will be removed in v13. Use functions and types from the Type module instead.
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>test
Deprecated
This has been deprecated and will be removed in v13. Use functions and types from the Type module instead.
let test: ('a, t<'b>) => booltest(value, t) returns true if value is typeof t, otherwise false.
This is useful for doing runtime reflection on any given value.
Examples
RESCRIPTtest("test", String) == true
test(() => true, Function) == true
test("test", Boolean) == false
tagged_t
Deprecated
This has been deprecated and will be removed in v13. Use functions and types from the Type module instead.
type tagged_t =
| JSFalse
| JSTrue
| JSNull
| JSUndefined
| JSNumber(float)
| JSString(string)
| JSFunction(function_val)
| JSObject(obj_val)
| JSSymbol(symbol)
| JSBigInt(bigint)classify
Deprecated
This has been deprecated and will be removed in v13. Use functions and types from the Type module instead.
let classify: 'a => tagged_t