Summing Up
Every ReasonML file is automatically a module, but you are free to define a module within a file at any time. A module within a file can contain anything that you’d put in a ReasonML file—for example, type definitions, function definitions, and even other modules.
ReasonML records are immutable data structures with field names that exist at compile time. You access the fields with the dot operator (.) and update fields (which creates a new record) using the spread operator (...). They look like JavaScript objects, but they aren’t.
If you’re still pining for JavaScript objects—or, more likely, you need to interoperate with existing JavaScript libraries that are object-based—well, that’s what we’ll look at in the next chapter. ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access