Rebecca Skinner - The Fixed Point

submited by
Style Pass
2021-06-12 10:00:09

Haskell offers ample opportunities for ah ha! moments, where figuring out just how some function or feature works can unlock a whole new way of thinking about how you write programs. One great example of an ah-ha moment comes from when you can first start to understand fixed points, why you might want to use them, and how exactly they work in haskell. In this post, you’ll work through the fixed point function in haskell, building several examples along the way. At the end of the post you’ll come away with a deeper understanding of recursion and how haskell’s lazy evaluation changes the way you can think about writing programs.

If you already have some experience with haskell, you may want to skip the first section and jump directly into learning about fix

A recursive function is a function that refers back to itself. In functional programming in general, and haskell in particular, recursion is common enough that we’ve developed several different names for it, each referring to some particular flavor or nuance of the way that the recursion is used. A couple of terms that will we’ll use as we’re working toward an understanding of fixed points in haskell are: manual recursion, automatic recursion, and recursive bindings. The terms In this section we’ll spend a bit of time looking at each of these, and building up some examples, so that we have a common framework for how we think about recursion, and a common language for understanding the finer points of how fixed points work.

Leave a Comment