|
|
|
|
|
by tel
4424 days ago
|
|
Well, as you go to the next steps you can use proof search techniques to do exactly that: write your types and your programs write themselves as the "only possible implementation". This is already possible sometimes in Haskell so long as we restrict ourselves from pathological values like exceptions and non-termination. In fact, the first place this phrase shows up is Russel O'Connor talking about highly polymorphic lens code. http://r6.ca/blog/20120708T122219Z.html This kind of type limitation of possible implementations is called parametricity and is difficult to encounter even in most typed languages as it requires purity. |
|
But there are only very few type signatures for which this is true, even if you stick to totality.