E-Ink News Daily

← Back to list

Differences between `foldl` and `foldr`

An educational article explaining the fundamental difference between foldl and foldr in Haskell: they traverse lists in the same left-to-right order, but differ in associativity—foldl is left-associated while foldr is right-associated. The article illustrates how this impacts behavior in strict vs. lazy evaluation contexts.

Background

This is a re-publication of a seminal tutorial originally posted on Hasura's GraphQL Engine repo in 2019. The article serves as a foundational reference for understanding Haskell folding operations.

Source
Lobsters
Published
Sep 30, 2026 at 08:47 PM
Score
5.0 / 10