module Types: Js_types
type
symbol
type
obj_val
type
undefined_val
undefined
type
null_val
null
type
function_val
type '_
t =
| |
Undefined | : | undefined_val t |
| |
Null | : | null_val t |
| |
Boolean | : | Js.boolean t |
| |
Number | : | float t |
| |
String | : | string t |
| |
Function | : | function_val t |
| |
Object | : | obj_val t |
| |
Symbol | : | symbol t |
val reify_type : 'a -> 'b t * 'b
'b t
is GADT, the type system will reify its type automatically,match reify_type "3" with | String, v -> v ^ " this type safe control flow analysis will infer v as string" | _ -> assert false
val test : 'a -> 'b t -> bool
test "x" String = true