4 ms·
Statically enforcing behavior helps the human as well - in this example, it would make it more clear what types of things you can do with an open connection vs
by thedufer 8y ago
Statically enforcing behavior helps the human as well - in this example, it would make it more clear what types of things you can do with an open connection vs a closed one just by inspecting the types, whereas otherwise you would have to either find documentation or test it and see.
We use type tricks like this (although not exactly in this way, as we don't really have a concept of kinds) in OCaml, and we find that in practice people new to the language aren't actually confused by it much - it actually makes readability better, not worse.