diff options
| author | krangelov <kr.angelov@gmail.com> | 2019-09-20 10:37:50 +0200 |
|---|---|---|
| committer | krangelov <kr.angelov@gmail.com> | 2019-09-20 10:37:50 +0200 |
| commit | 4d79aa8b198f411d0ab6d66d76d9f77dfd3f922f (patch) | |
| tree | 0f72e72c6f5ccf57111b22cdb736b3290c86d1dd /src/compiler/GF/Data/Operations.hs | |
| parent | 9d3badd8b225378269814e79395ae48beb83fa4d (diff) | |
remove obsolete code
Diffstat (limited to 'src/compiler/GF/Data/Operations.hs')
| -rw-r--r-- | src/compiler/GF/Data/Operations.hs | 52 |
1 files changed, 1 insertions, 51 deletions
diff --git a/src/compiler/GF/Data/Operations.hs b/src/compiler/GF/Data/Operations.hs index 3c8b16b8a..7e16b6d17 100644 --- a/src/compiler/GF/Data/Operations.hs +++ b/src/compiler/GF/Data/Operations.hs @@ -28,14 +28,6 @@ module GF.Data.Operations ( -- ** Monadic operations on lists and pairs mapPairListM, mapPairsM, pairM, - - -- ** Binary search trees; now with FiniteMap - BinTree, emptyBinTree, isInBinTree, --justLookupTree, - lookupTree, --lookupTreeMany, - lookupTreeManyAll, updateTree, - buildTree, filterBinTree, - mapTree, --mapMTree, - tree2list, -- ** Printing indent, (+++), (++-), (++++), (+++-), (+++++), @@ -50,10 +42,6 @@ module GF.Data.Operations ( ifNull, combinations, done, readIntArg, --singleton, iterFix, chunks, -{- - -- ** State monad with error; from Agda 6\/11\/2001 - STM(..), appSTM, stm, stmr, readSTM, updateSTM, writeSTM, --} ) where @@ -117,44 +105,6 @@ unifyMaybeBy f (Just p1) (Just p2) unifyMaybeBy _ Nothing mp2 = return mp2 unifyMaybeBy _ mp1 _ = return mp1 --- binary search trees - -type BinTree a b = Map a b - -emptyBinTree :: BinTree a b -emptyBinTree = Map.empty - -isInBinTree :: (Ord a) => a -> BinTree a b -> Bool -isInBinTree = Map.member -{- -justLookupTree :: (ErrorMonad m,Ord a) => a -> BinTree a b -> m b -justLookupTree = lookupTree (const []) --} -lookupTree :: (ErrorMonad m,Ord a) => (a -> String) -> a -> BinTree a b -> m b -lookupTree pr x = maybeErr no . Map.lookup x - where no = "no occurrence of element" +++ 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 = [] - -updateTree :: (Ord a) => (a,b) -> BinTree a b -> BinTree a b -updateTree (a,b) = Map.insert a b - -buildTree :: (Ord a) => [(a,b)] -> BinTree a b -buildTree = Map.fromList - -mapTree :: ((a,b) -> c) -> BinTree a b -> BinTree a c -mapTree f = Map.mapWithKey (\k v -> f (k,v)) - -filterBinTree :: Ord a => (a -> b -> Bool) -> BinTree a b -> BinTree a b -filterBinTree = Map.filterWithKey - -tree2list :: BinTree a b -> [(a,b)] -- inorder -tree2list = Map.toList - -- printing indent :: Int -> String -> String @@ -377,4 +327,4 @@ doUntil cond ms = case ms of v <- a if cond v then return v else doUntil cond as _ -> raise "no result" --}
\ No newline at end of file +-} |
