summaryrefslogtreecommitdiff
path: root/src/GF/Data/RedBlack.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/GF/Data/RedBlack.hs')
-rw-r--r--src/GF/Data/RedBlack.hs5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/GF/Data/RedBlack.hs b/src/GF/Data/RedBlack.hs
index 8a24c07a3..4ee1f92a6 100644
--- a/src/GF/Data/RedBlack.hs
+++ b/src/GF/Data/RedBlack.hs
@@ -10,6 +10,7 @@
module RedBlack (
emptyTree,
+ isEmpty,
Tree,
lookupTree,
insertTree,
@@ -32,6 +33,10 @@ balance color a x b = T color a x b
emptyTree :: Tree key el
emptyTree = E
+isEmpty :: Tree key el -> Bool
+isEmpty (E) = True
+isEmpty _ = False
+
lookupTree :: Ord a => a -> Tree a b -> Maybe b
lookupTree _ E = Nothing
lookupTree x (T _ a (y,z) b)