Skip to content

Commit 3ed6c34

Browse files
Document non-trivial function Code.constant_equal
Co-authored-by: Jérome Vouillon <jerome.vouillon@gmail.com>
1 parent 3204c33 commit 3ed6c34

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

compiler/lib/code.mli

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,9 @@ type constant =
185185
| Tuple of int * constant array * array_or_not
186186
| Int of int32
187187

188+
(** Guaranteed equality in terms of both OCaml [(=)] and Javascript [(==)]: if
189+
[constant_equal a b = Some v], then [Poly.(=) a b = v] and
190+
[Js_of_ocaml.Js.equals a b = v]. This is used for optimization purposes. *)
188191
val constant_equal : constant -> constant -> bool option
189192

190193
type loc =

0 commit comments

Comments
 (0)