Nested Records
Explore how to create nested records in ReasonML by defining nested record types and incorporating sub-records into main records. Understand punning techniques to simplify your code and make complex data structures more manageable.
We'll cover the following...
We'll cover the following...
Type Nesting
In order to create nested records, we must first create nested record types. Once the record’s type structure allows nesting, we’ll have no problem creating nested records.
So, let’s work on our wizardInfo example from the previous lesson. We’ll be defining the schoolInfo type which contains the attributes school and house:
...