gleam-lang / language-tour

👩🏽‍💻 Learn Gleam in your browser
https://tour.gleam.run/
74 stars 55 forks source link

A misunderstanding can be avoided in the Higher order functions and Anonymous Functions section. #52

Closed vidalvasconcelos closed 4 months ago

vidalvasconcelos commented 4 months ago

Although the fn keyword was introduced in the previous section, using "function" to name variables and parameters may produce more misunderstandings than benefits.

fn twice(argument: Int, function: fn(Int) -> Int) -> Int {
  function(function(argument))
}
lpil commented 4 months ago

Thank you!