Haskell - About Curried

In Haskell, all functions are initially charged, right?

So, let's take a look at the function max, and I will write that I understand how this works.

When I write something like this:

max 4 5

What happens is that a new function is created that internally has a value of 4, which then gets the value, so this function is applied to 5 and the correct value is returned?

Am I saying something wrong or is it right?

+5
source share
1 answer

It is right. You can recall what currying is, remembering two of its most important identities:

-- Function type right-associativity:
a -> b -> c = a -> (b -> c)

-- Function application left-associativity:
f x y = (f x) y

These two identities work together and produce curry language.

+9
source

All Articles