Created
July 24, 2014 02:52
-
-
Save mwotton/c1bf236251424a887964 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
delete :: Ord k => k -> Map k a -> Map k a | |
delete = go | |
where | |
go :: Ord k => k -> Map k a -> Map k a | |
go _ Tip = Tip | |
go k (Bin _ kx x l r) = | |
case compare k kx of | |
LT -> balanceR kx x (go k l) r | |
GT -> balanceL kx x l (go k r) | |
EQ -> glue l r |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment