exploring-reasonml
exploring-reasonml copied to clipboard
Chapter: Basic values and types
Should last sentence be === is the preferred equality operator (unless you really want to compare references).
instead of == is the preferred equality operator (unless you really want to compare references).
The text is correct as is, === compares references whilst == compares values.
After some discussion on Discord, I think the claim
ReasonML strings are encoded as UTF-8 and not compatible with JavaScript’s UTF-16 strings
Is wrong. It also goes against the docs here:
Since a Reason string maps to a JavaScript string, you can mix & match the string operations in both standard libraries
What really seems to happen is that if you use Reason string literals, it encodes in utf-8 but saves it to a JS-string. So the underlying type does support Unicode, and there is full interoperation between JS-strings and Reason strings. You just need to use the JS syntax to express unicode.