Writing Higher-Order Functions With Scala

Jyoti Sachdeva explains the concept of higher-order functions and shares an example in Scala:

In this blog, I’m going to explain higher-order functions.

A higher order function takes other function as a parameter or return a function as a result.

This is possible because functions are first-class value in scala. What does that mean?

It means that functions can be passed as arguments to other functions and functions can return other function.

The map function is a classic example of a higher order function.

Higher-order functions are one of the key components to functional programming and allows us to reason in small chunks at a time

Related Posts

Monads and Monoids and Functors

Anmol Sarna explains the concept of a monad: In functional programming, a monad is a design pattern that allows structuring programs generically while automating away boilerplate code needed by the program logic. To simplify the above definition a bit more, We can think of monads as wrappers. You just take an object and wrap it with […]

Read More

Reviewing the Stack Overflow Developer Survey

Michael Toth looks at the recently-released 2019 Stack Overflow Developer Survey: Since 2011, Stack Overflow has been surveying their users each year to answer questions about the technologies they use, their work experience, their compensation, and their satisfaction at work. Given Stack Overflow’s place in the broader programming world, they are able to draw quite […]

Read More


October 2018
« Sep Nov »