Question: I don't understand composing functions with arity > 1.
in ghci 7.4.1 i typed:

```
((*).succ) 3 4
> 16

```

i don't fully understand the math transformation but it's clear that it's the same as

```
(*) (succ 3) 4

```

but when i do:

```
( (\x y z -> x).(\a b -> a*b) ) 2 3 4 5
> 10
( (\x y z -> y).(\a b -> a*b) ) 2 3 4 5
> No instance for (Num (a0 -> t0))

```

and now i'm totally lost. can anyone explain what happens? ps. I know that everything in haskell has only 1 parameter but it doesn't really help me :)

Answer: 
Work it out this way:

```
(f . g) x = f (g x)
(f . g) x y = f (g x) y -- applying y

```

Then replace f with `(*)`, g with `succ` and x and y with their values:

```
((*) . succ) 3 4 = (*) (succ 3) 4
                 = (*) 4 4
                 = 16

```
Since you understand everything is a one-argument function, let's start from that point. Keep in mind that (\x y z -> x) is really (\x -> (\y z -> x)), which in turn really is (\x -> (\y -> (\z -> x))), but let's stop at the first step to keep the noise from brackets down.

`(f . g) x = f (g x)`

hence

```
((\x -> (\y z -> x)) . (\a b -> a*b)) 2 =
(\x -> (\y z -> x)) ((\a -> (\b -> a*b)) 2) =
(\x -> (\y z -> x)) (\b -> 2*b) =
(\y z -> (\b -> 2*b))

```

Now remember the second step and expand (\y z -> ...):

```
(\y z -> (\b -> 2*b)) 3 4 =
(\y -> (\z -> (\b -> 2*b))) 3 4 =
   -- \y -> ... given anything, returns a function \z -> ...
(\z -> (\b -> 2*b)) 4 =
   -- \z -> ... given anything, returns a function \b -> ...
(\b -> 2*b)

```

which finally is:

```
(\b -> 2*b) 5 = 2*5 = 10

```

The story unfolds differently, if the first function returns y instead of x:

```
((\x -> (\y z -> y)) . (\a -> (\b -> a*b))) 2 =
(\x -> (\y z -> y)) ((\a -> (\b -> a*b)) 2) =
(\x -> (\y z -> y)) (\b -> 2*b) =
   -- \x -> ... given anything, returns a function \y z -> ...
(\y z -> y)

```

so you get:

```
(\y -> (\z -> y)) 3 4 5 =
   -- \y -> ... given anything, returns a function \z -> ...
(\z -> 3) 4 5 =
   -- \z -> ... given anything, returns a constant 3
3 5  -- now still trying to apply 5 to 3

```

It is attempting to treat `3` as a function that can take `5`.