by tel · 12y ago · 0 comments
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.
That occurs quite often.