DEV Community

Discussion on: Emulating TypeScript union types with ReasonML

Collapse
 
yawaramin profile image
Yawar Amin

Extensible variants are fun indeed 🙂 the technique I suggested with polyvariants will warn about typos though because of the way the function is defined with the polyvariant value being the function parameter. Its type is inferred as [< `arrowDown | `arrowLeft], so a typo like `arrowDonw will give the same kind of type error as I show in the post.