From d7097e0d05c37652402971093a2ce2c2a73281f4 Mon Sep 17 00:00:00 2001 From: davve Date: Fri, 11 Aug 2006 20:31:51 +0000 Subject: Cleanup --- src/Map.hs | 62 -------------------------------------------------------------- 1 file changed, 62 deletions(-) delete mode 100644 src/Map.hs (limited to 'src/Map.hs') diff --git a/src/Map.hs b/src/Map.hs deleted file mode 100644 index 7d4c75df..00000000 --- a/src/Map.hs +++ /dev/null @@ -1,62 +0,0 @@ -module Map ( - Map, - member, lookup, findWithDefault, - empty, - insert, insertWith, - union, unionWith, unions, - elems, - fromList, fromListWith, - toAscList -) where - -import Prelude hiding ( lookup ) - -#if __GLASGOW_HASKELL__ >= 603 -import Data.Map -#else -import Data.FiniteMap - -type Map k a = FiniteMap k a - -instance Functor (FiniteMap k) where - fmap f = mapFM (const f) - -member :: Ord k => k -> Map k a -> Bool -member = elemFM - -lookup :: Ord k => k -> Map k a -> Maybe a -lookup = flip lookupFM - -findWithDefault :: Ord k => a -> k -> Map k a -> a -findWithDefault a k m = lookupWithDefaultFM m a k - -empty :: Map k a -empty = emptyFM - -insert :: Ord k => k -> a -> Map k a -> Map k a -insert k a m = addToFM m k a - -insertWith :: Ord k => (a -> a -> a) -> k -> a -> Map k a -> Map k a -insertWith c k a m = addToFM_C (flip c) m k a - -union :: Ord k => Map k a -> Map k a -> Map k a -union = flip plusFM - -unionWith :: Ord k => (a -> a -> a) -> Map k a -> Map k a -> Map k a -unionWith c l r = plusFM_C (flip c) r l - -unions :: Ord k => [Map k a] -> Map k a -unions = foldl (flip plusFM) emptyFM - -elems :: Map k a -> [a] -elems = eltsFM - -fromList :: Ord k => [(k,a)] -> Map k a -fromList = listToFM - -fromListWith :: Ord k => (a -> a -> a) -> [(k,a)] -> Map k a -fromListWith c = addListToFM_C (flip c) emptyFM - -toAscList :: Map k a -> [(k,a)] -toAscList = fmToList -#endif -- cgit v1.2.3