Home / DeveloperSection / Blogs / Higher Order Function in Erlang.

Higher Order Function in Erlang.

Sunil Singh 2515 17-Jun-2015

In mathematics and computer science, a higher-order function (also functional form, functional or functor) is a function that does at least one of the following: takes one or more functions as an input. 

An important part of all functional programming languages is the ability to take a function you defined and then pass it as a parameter to another function. This, in turn, binds that function parameter to a variable which can be used like any other variable within the function.

 A function that can accept other functions transported around that way is named a higher order function. Higher-order functions are a powerful means of abstraction and one of the best tools to master in Erlang.

For example-

one() -> 1.
two() -> 2.
add(X,Y) -> X() + Y().
functions:add(fun functions:one/0,fun functions:two/0). // function call


Updated 24-Feb-2018

Leave Comment

Please enter subject.
Please enter comments message.


Liked By