diff options
| author | markus <unknown> | 2003-11-11 11:59:21 +0000 |
|---|---|---|
| committer | markus <unknown> | 2003-11-11 11:59:21 +0000 |
| commit | 9b47b4aa128a5cbee74aa99e5494a0b76890ec4a (patch) | |
| tree | 0a870fa527b8fea0c98d6906d90ebac72872504a /src/GF/Data/RedBlack.hs | |
| parent | b5685411125cb5cafe86c7761b0632b83c25f449 (diff) | |
Added a collapse function to Trie
Diffstat (limited to 'src/GF/Data/RedBlack.hs')
| -rw-r--r-- | src/GF/Data/RedBlack.hs | 5 |
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) |
