24
It's a term taken from purely functional languages such as Haskell or Erlang where functions are first class citizens. It means that functions can be passed as arguments to other functions and functions can return other functions.
Because functions are first class citizens – we have a function type – signified by an arrow. In haskel: (->) In skala: (=>)
Consider map function. It's a function which takes a function and a list as its arguments and applies given function to all the elements of the list:
in haskell:
map(\x->x+1)[1,2,3]
= [2,3,4]
in scala:
List(1,2,3) map (x => x + 1)
= [2,3,4]
(\x->x+1) and (x => x + 1) are functions (denoted by lambda expressions) passed to map function as arguments.