From 9b47b4aa128a5cbee74aa99e5494a0b76890ec4a Mon Sep 17 00:00:00 2001 From: markus Date: Tue, 11 Nov 2003 11:59:21 +0000 Subject: Added a collapse function to Trie --- src/GF/Data/RedBlack.hs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/GF/Data/RedBlack.hs') 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) -- cgit v1.2.3