May 2021 update: I wrote this article when Coronate was using ReasonML and ReasonReact. Those projects have since been replaced with ReScript. ReSc...
For further actions, you may consider blocking this person and/or reporting abuse
This is great. I'm just starting to get into reason and its nice to have a real world projects source code to browse for ides. 👍
Regarding the rei files. Is it intended that the .re files also have types? Isn't it duplicate work to have types in both?
Type definitions, like
type t = | A | B;, will have to be in both files. Type annotations are only necessary in .rei files. For example:Whether you want to also annotate the types of the values in your .re file too is a matter of preference. Sometimes they can help you understand and debug code, but the compiler rarely needs them.
Very often, you won't need to copy the whole type definition to the .rei file, and you can keep it opaque instead. This is handy when your data is complicated and you don't want to leak its internal complexities across your whole project.
thanks John, good to know. This was very helpful
Awesome post!