Iterated currying and mapping — better solutions?

My own attempt at writing a “multi-curry” function is here, motivated, like yours, by a need to transform functions independently of their number of arguments.

In order for it to work, I had to restrict the allowable functions to those that have a certain concrete monad at the “tip”. Otherwise the compiler finds difficult to determine what is the true “tip” of the function (I did not want to use overlapping instances.)

Instead of reinventing some inductive tuple, I used the NP type from sop-core for storing the uncurried parameters.