Skip to content

Commit

Permalink
Variants: Add some TODOs
Browse files Browse the repository at this point in the history
  • Loading branch information
fhammerschmidt committed Oct 22, 2023
1 parent 9176a31 commit c0e1d90
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions pages/docs/manual/latest/variant.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -432,6 +432,18 @@ let usersToJson = users => Array(users->Array.map(userToJson))

This can be extrapolated to many more cases.

// ### Unboxable types

// TODO #734: Add a list of what can currently be unboxed (and why), and a note that it's possible that more things could be unboxed in the future.

// ### Catch all

// TODO #733: Add a small section on the "catch all" trick, and what kind of things that enable.

// ## Variant spread

// TODO #732

## Coercion

You can convert a variant to a `string` or `int` at no cost:
Expand All @@ -452,6 +464,12 @@ var message = "Hello " + theCompany;

</CodeTab>

// TODO #731: expand this section with:
//
// Coercing between variants (and the constraints around that)
// Why you can sometimes coerce from variant to string/int/float, and how to think about that (runtime representation must match)
// The last additions of allowing coercing strings to unboxed variants with catch-all string cases

## Tips & Tricks

**Be careful** not to confuse a constructor carrying 2 arguments with a constructor carrying a single tuple argument:
Expand Down

0 comments on commit c0e1d90

Please sign in to comment.