Skip to content

Commit fd124ea

Browse files
committed
feat: Document type.mli
1 parent a0651c0 commit fd124ea

File tree

1 file changed

+58
-0
lines changed

1 file changed

+58
-0
lines changed

src/type.mli

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,83 @@
11
type t
2+
(** Represents a Binaryen wasm type. *)
23

34
val none : t
5+
(** The none type, e.g., [void.] *)
6+
47
val int32 : t
8+
(** The 32-bit integer type. *)
9+
510
val int64 : t
11+
(** The 64-bit integer type. *)
12+
613
val float32 : t
14+
(** The 32-bit float type. *)
15+
716
val float64 : t
17+
(** The 64-bit float type. *)
18+
819
val vec128 : t
20+
(** The 128-bit vector type. *)
21+
922
val funcref : t
23+
(** The function reference type. *)
24+
1025
val anyref : t
26+
(** The any reference type. *)
27+
1128
val eqref : t
29+
(** The eq reference type. *)
30+
1231
val i31ref : t
32+
(** The i31 reference type. *)
33+
1334
val structref : t
35+
(** The struct reference type. *)
36+
1437
val arrayref : t
38+
(** The array reference type. *)
39+
1540
val stringref : t
41+
(** The string reference type. *)
42+
1643
val nullref : t
44+
(** The null reference type. *)
45+
1746
val null_externref : t
47+
(** The null external reference type. *)
48+
1849
val null_funcref : t
50+
(** The null function reference type. *)
51+
1952
val unreachable : t
53+
(** A special type indicating unreachable code when obtaining information about
54+
an expression. *)
55+
2056
val auto : t
57+
(** A special type used in [Expression.Block] exclusively. Lets the API figure
58+
out a block's result type automatically. *)
59+
2160
val create : t array -> t
61+
(** Creates a multi-value type from an array of types.
62+
@param Types The array of types
63+
@return The multi-value type *)
64+
2265
val expand : t -> t array
66+
(** Expands a multi-value type to an array of types.
67+
@param type The multi-value type
68+
@return The types in the multi-value type *)
69+
2370
val is_nullable : t -> bool
71+
(** Weather the given type is nullable.
72+
@param type The type to check
73+
@return [true] if the type is nullable, [false] otherwise *)
74+
2475
val from_heap_type : Heap_type.t -> t
76+
(** Produces a regular type from the given heap type.
77+
@param heap_type The heap type
78+
@return The corresponding type *)
79+
2580
val get_heap_type : t -> Heap_type.t
81+
(** Gets the heap type of the given type.
82+
@param type The type
83+
@return The corresponding heap type *)

0 commit comments

Comments
 (0)