Higher Order Functions

Functions like map, filter and foldr are also called higher order functions, becuase they take a function as their argument. A higher order function takes a function as its argument or/and returns a function as it’s result.

Here are some more examples of such functions.

  1. apply :: forall a b. (a -> b) -> a -> b
  2. apply f x = f x
  3. compose :: forall a b. (b -> c) -> (a -> b) -> a -> c
  4. compose g f x = g (f x)