notes src first-class-functions.md
851 B · 17 lines
Markdown
at main

First-Class Functions #

First-class functions refers to the treatment of @[functions][] as values, which is supported by a number of @[programming languages][programming-language], typically those that are @[functional][functional-programming] languages (or share qualities with functional languages).

Though many languages support passing functions to other functions, not all such languages would be considered to have first-class functions. @[C][], for example, does allow passing pointers to functions around, allowing many similar behaviours as first-class functions would, but since you cannot truly create and pass functions around directly, they would not be considered first-class.

Languages with first class functions include (among others):

  • @[Javascript][]
  • @[Haskell][] (and in fact, all functional languages)
  • @[Rust][]