|
|
|
|
|
by colonwqbang
1544 days ago
|
|
Doesn't "flow typing" seem more like a bandage for the if-statement in languages that have nothing better. There is a language construct which is purpose built for unpacking sum types: The case expression (sometimes called match expression) case resp of
Views n -> ...
Error e -> ...
Inside each branch, we have access to a value of the more specific type. |
|