Syntax Lookup
Enter some language construct you want to know more about.
This is the type coercion operator.
The :>
operator may be used to convert a polymorphic variant to a string
or int
, or convert an object to a type with a subset of its fields.
Since ReScript 11.0.0
coercion also works for converting
from
int
tofloat
from record to record with the same field(s) or when record A is a subtype of record B
from
@unboxed
variant with only strings tostring
from
string
to@unboxed
variant that have a catch-all unboxedstring
casefrom variant to variant when applicable
from variant to
string
/int
/float
when applicablefor invariant type arguments such as array payloads when the runtime representation is guaranteed to be exactly the same