News for hackers. Stuff that matters.
Re:Interesting features from various modern programming lang... by yorwba on Friday November 10, 2017 @03:46AM (#15668717)
You can do arity overloading with curried functions if you allow overloading the function application operator itself. E.g. if f is of type A → B and a is of type Decoder A then map f a is of type Decoder B and in the special case where B is a function type C → D, that Decoder B = Decoder (C → D) can be applied to a value c of type Decoder C making map f a c a Decoder D.

Caveat: I'm not aware of any language that actually does this, likely because redefining the core syntax of function application would be so easy to abuse.

EDIT: Removed my Haskell example, because I think I got it wrong.

There are no comments on this comment yet.