Lesson 3. Lambda functions and lexical scope

After reading lesson 3, you’ll be able to

  • Write lambda functions in Haskell
  • Use lambda functions for ad hoc function definitions
  • Understand lexical scope
  • Create scope with a lambda function

In this lesson, you’re going to continue your journey into understanding functional programming and Haskell by learning about one of the most foundational concepts in all of functional programming: the lambda function. On the surface, a lambda function—which is a function with no name—seems almost too simple to be interesting. But lambda functions provide incredible theoretical benefits as well as a surprising amount of real-world usefulness.

Consider this

You’re messing around in GHCi and want ...

Get Get Programming with Haskell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.