From 825fcfc383e9ce9f9f3865e38278281a245ff1e0 Mon Sep 17 00:00:00 2001 From: Gabriel Nordeborn Date: Wed, 10 Jan 2024 08:07:35 +0100 Subject: [PATCH] fix docs on unboxed int --- pages/docs/manual/latest/variant.mdx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pages/docs/manual/latest/variant.mdx b/pages/docs/manual/latest/variant.mdx index ac5a842bb..47c7a7312 100644 --- a/pages/docs/manual/latest/variant.mdx +++ b/pages/docs/manual/latest/variant.mdx @@ -363,7 +363,8 @@ Don't worry - the compiler will guide you and ensure there's no overlap. #### What you can unbox Here's a list of all possible things you can unbox: - `string`: `String(string)` -- `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. +- `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. +- `int`: `Int(int)`. See note above on `float`. - `bool`: `Boolean(bool)` - `array<'value>`: `List(array)` - `('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.