Higher order functions

In Gleam functions are values. They can be assigned to variables, passed to other functions, and anything else you can do with values.

Here the function add_one is being passed as an argument to the twice function.

Notice the fn keyword is also used to describe the type of the function that twice takes as its second argument.