Skip to content

Instantly share code, notes, and snippets.

@EncodePanda
EncodePanda / TwoThreeTree.hs
Last active November 21, 2021 21:51
First attempt to implement 2-3 tree as outlined in the "Finger Trees: A Simple General-purpose Data Structure" paper
-- λ> fromList [1]
-- Zero 1
-- λ> fromList [1..2]
-- Succ (Zero (Node2 1 2))
-- λ> fromList [1..4]
-- Succ (Succ (Zero (Node2 (Node2 1 2) (Node2 3 4))))
-- λ> fromList [1..8]