Now that our trees balance themselves we can keep replicating the built-in set API.
This week, we’ll answer two questions:
- Is an item in the set?
- How many items are in the set?
And we’re going to do it recursively!
Last time we started making a set using a binary search tree.
Let’s continue by adding more functionality to our set!
We’re going to improve it by making sure our set stays in proper order.
Today we’re starting a series on building functional data structures using Elm.
The goal: build a native set implementation from first principles.
We’re going to reimplement the standard library’s Set API.
This is going to be a toy implementation, so we won’t optimize as much as we could, but we’ll be able to learn some new things!
You know how you stay up late trying to figure out why your recursive types just. won’t. decode?
I’ve done it too.
Wouldn’t it be nice if it would, you know, just work how you wanted it to?
Json.Decode.Extra.lazy exists, so it you can get it to work right away!