I've found that there isn't a concept similar to "arity-based subtyping" in many languages that I've programmed in, where higher-order functions could consume functions of lower arity than their argument type, differing in a consistent way: say, preserving leftmost arguments in order, or requiring name-type pairs to match. For example, (A) -> C <: (A, B) -> C
such that ((A, B) -> C) -> D
admits (A) -> C
. Would such a feature be equivalent to ad hoc polymorphism, and if so, why isn't it offered or used much/at all?
A special case that I'm particularly interested in is substituting values for functions of the same return type without wrapping in an identity function, i.e. ((A) -> B) -> C
admitting B
. If this exists and is better known under a different name, that would also certainly answer my question.