March 2019
Intermediate to advanced
208 pages
5h 11m
English
Our program currently shows the distribution only for colors. Add the code to show distribution for size, sleeve, pattern, cuff, and collar.
Here are some things to consider:
You’ll need to implement comparators for all the data types. All of them can use the built-in compare procedure, but if you try using it with the Size.t type, you will get some interesting results.
| | Js.log(compare(Size.Small, Size.Medium)); /* -1 as expected */ |
| | Js.log(compare(Size.XLarge(3), Size.XLarge(2))); /* 1 as expected */ |
| | Js.log(compare(Size.Large, Size.XLarge(1))); /* -1 as expected */ |
| | Js.log(compare(Size.XSmall(2), Size.Medium)); /* 1 not as expected */ |
Because of the way ReasonML represents ...
Read now
Unlock full access