Why does the following typecheck?

```
cancel x y = x
distribute f g x = f x (g x)
identity = distribute cancel cancel

```

Clearly `cancel :: a -> b -> a`, `distribute :: (a -> b -> c) -> (a -> b) -> a -> c` and `identity :: a -> a`. Now, `distribute cancel :: (a -> b) -> a -> a`, but I don't understand why `cancel` matches with `a -> b`.

Could anyone explain this to me?