Type refinement is all about making the types more precise. But why would do that? Because using the correct types makes your program safer as you reduce the possibility to introduce bugs.
First let’s think about types. For instance
String is a type we use all the time. A variable of type
String can have many different values (in theory an infinity of values) but it’s quite unlikely that all these values make sense in our application. Continue reading “Refined types, what are they good for?”