You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using tuples is a nice way to model heterogeneous arrays in rescript, but so far they're not allowed in unboxed/untagged variants, even though they're compiled to regular arrays in js, and arrays are allowed in untagged variants.
It'd be cool to add tuples to the allowed types in untagged variants.
this is interesting, because indeed, we could solve the same issue by allowing objects to be compiled to arrays (it's likely much more work though), something like:
typet=
| Foo({@as(0) foo: int, @as(1) bar: string})
Using tuples is a nice way to model heterogeneous arrays in rescript, but so far they're not allowed in unboxed/untagged variants, even though they're compiled to regular arrays in js, and arrays are allowed in untagged variants.
It'd be cool to add tuples to the allowed types in untagged variants.
See forum post for a use case.
We'd basically allow tuples and we'd check that only one variant case can be of type array or tuple.
The text was updated successfully, but these errors were encountered: