Functional Sets


In this series of guides, I show you how to build a functional data structure using Elm. Our goal: build a set implementation from first principles, reimplementing the standard library’s Set API.

Functional Sets, Part 1: Construction

Functional Sets, Part 2: Rotation

Functional Sets, Part 3: Balancing

Functional Sets, Part 4: Recursive Membership and Size

Interlude: The Care and Feeding of Folds in Elm

Functional Sets, Part 5: Folds

Functional Sets, Part 6: Union and Remove

Functional Sets, Part 7: Filter, Diff, and Intersect

Functional Sets, Part 8: Map

Functional Sets, Part 9: Wrap-up