February 2019
Beginner to intermediate
180 pages
4h 4m
English
Reason lists are as follows:
They look like this:
let list = ["first", "second", "third"];
The head of the list, in this case, is "first". By now, we've seen that it's not difficult to work with immutable data structures. Instead of mutation, we create updated copies.
When working with lists, we can't use JavaScript bindings directly, since lists do not exist in JavaScript as a primitive data structure. However, we can convert lists to arrays and vice versa:
/* Belt standard library */let list = ["first", "second", "third"];let array = Belt.List.toArray(list);let array = [|"first", "second", "third"|];let list = Belt.List.fromArray(array);/* Reason standard ...
Read now
Unlock full access