checking name conflicts; some RGs don't work now

This commit is contained in:
aarne
2007-06-17 21:56:27 +00:00
parent adf0f8e83e
commit 3adf824e8e
13 changed files with 101 additions and 81 deletions

View File

@@ -34,7 +34,7 @@ module GF.Data.Operations (-- * misc functions
-- * binary search trees; now with FiniteMap
BinTree, emptyBinTree, isInBinTree, justLookupTree,
lookupTree, lookupTreeMany, updateTree,
lookupTree, lookupTreeMany, lookupTreeManyAll, updateTree,
buildTree, filterBinTree,
sorted2tree, mapTree, mapMTree, tree2list,
@@ -318,6 +318,12 @@ lookupTreeMany pr (t:ts) x = case lookupTree pr x t of
_ -> lookupTreeMany pr ts x
lookupTreeMany pr [] x = Bad $ "failed to find" +++ pr x
lookupTreeManyAll :: Ord a => (a -> String) -> [BinTree a b] -> a -> [b]
lookupTreeManyAll pr (t:ts) x = case lookupTree pr x t of
Ok v -> v : lookupTreeManyAll pr ts x
_ -> lookupTreeManyAll pr ts x
lookupTreeManyAll pr [] x = []
-- | destructive update
updateTree :: (Ord a) => (a,b) -> BinTree a b -> BinTree a b
-- updateTree (a,b) tr = addToFM tr a b