Skip to content

Commit 41a7fd3

Browse files
authored
fix docs on unboxed int (#781)
1 parent d3c97fa commit 41a7fd3

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pages/docs/manual/latest/variant.mdx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,8 @@ Don't worry - the compiler will guide you and ensure there's no overlap.
363363
#### What you can unbox
364364
Here's a list of all possible things you can unbox:
365365
- `string`: `String(string)`
366-
- `float`: `Number(float)`. Notice `int` cannot be unboxed, because JavaScript only has `number` (not actually `int` and `float` like in ReScript) so we can't disambiguate between `float` and `int` at runtime.
366+
- `float`: `Float(float)`. Note you can only have one of `float` or `int` because JavaScript only has `number` (not actually `int` and `float` like in ReScript) so we can't disambiguate between `float` and `int` at runtime.
367+
- `int`: `Int(int)`. See note above on `float`.
367368
- `bool`: `Boolean(bool)`
368369
- `array<'value>`: `List(array<string>)`
369370
- `('a, 'b, 'c)`: `Tuple((string, int, bool))`. Any size of tuples works, but you can have only one case of array or tuple in a variant.

0 commit comments

Comments
 (0)