|
|
|
|
|
by amw-zero
1085 days ago
|
|
The pros of any type-level logic all boil down to automatically enforcing something that you want to be enforced. The key word being _automatically_. This can be frustrating in the moment sometimes, but other times a type can do two really powerful things: 1. prevent someone you’ve never spoken to from doing something legitimately dangerous
2. provide browsable documentation about the constraint its enforcing and how other places in the code resolve the constraint. It doesn’t always work out that way, sure, but that’s the ideal types are striving for. |
|
It doesn't provide "browsable documentation". It provides complex unreadable types that you have to painstakingly manually "compile" in your head to figure out what the hell is going on