Skip to content

L-as/idris-rbtree

Repository files navigation

Type-safe verified red-black trees in Idris.

Check TypedContainers/RBTree.idr for the basic API. Your key type needs to implement LawfulOrd (see TypedContainers/LawfulOrd.idr).

NB: Space complexities and time complexities should be the same as standard Red-Black trees, however, it has not been proven.

Features:

  • Value type can depend on key

The algorithm is taken from Purely functional data structures by Chris Okasaki. The proofs were mostly left as an exercise to the reader. The only difference is that the root of the tree isn't always made red, since this isn't always required.

TODO:

  • Benchmark

About

Type-safe verified Red-Black Trees in Idris 2

Resources

License

Stars

Watchers

Forks

Releases

No releases published