O'Reilly logo

Get Programming with Haskell by Will Kurt

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Lesson 5. Closures and partial application

After reading lesson 5, you’ll be able to

  • Capture values in a lambda expression
  • Use closures to create new functions
  • Simplify this process with partial application

In this lesson, you’ll learn the final key element of functional programming: closures. Closures are the logical consequence of having lambda functions and first-class functions. By combining these lambda functions and first-class functions to create closures, you can dynamically create functions. This turns out to be an incredibly powerful abstraction, though the one that takes the most getting used to. Haskell makes closures much easier to work with by allowing for partial application. By the end of the lesson, you’ll see how partial ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required