[Haskell-beginners] How does the type of "ap = liftM2 id" work?
apfelmus at quantentunnel.de
Mon Aug 25 04:02:47 EDT 2008
Brandon S. Allbery KF8NH wrote:
> Quergle Quergle wrote:
>> My intuitive understanding is that liftM2 is expecting a two-argument
>> function as its first argument, so it seems a little unexpected to
>> pass it "id", a one-argument function.
> And because in
> Haskell a multiple-argument function is identical to a single-argument
> function returning a single-argument function, the type of "id"
> encompasses any number of arguments.
In other words, there are no two-argument functions in Haskell anyway. Every
function has only one argument.
More information about the Beginners