|
|
|
|
|
by imiric
1079 days ago
|
|
Conversely, and I don't mean to sound flippant, but are there any pros of (ab)using types in this way? These projects are interesting in an amusing "oh look, another Turing complete type system" way, for the author to gain expertise, and as something to highlight in CVs and to chat about during interviews. But other than that, I would never actually choose to use any of this in a real-world project. Depending on the stability of this API (TPI?), and subjecting colleagues to esoteric libraries would be a nightmare to maintain and support. |
|
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.