~ubuntu-branches/ubuntu/precise/ghc/precise

« back to all changes in this revision

Viewing changes to utils/hpc/HpcMap.hs

  • Committer: Bazaar Package Importer
  • Author(s): Joachim Breitner
  • Date: 2011-01-17 12:49:24 UTC
  • Revision ID: james.westby@ubuntu.com-20110117124924-do1pym1jlf5o636m
Tags: upstream-7.0.1
ImportĀ upstreamĀ versionĀ 7.0.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
module HpcMap ( module HpcMap ) where
 
2
 
 
3
#if __GLASGOW_HASKELL__ < 604
 
4
import qualified Data.FiniteMap as Map
 
5
#else
 
6
import qualified Data.Map as Map
 
7
#endif
 
8
 
 
9
 
 
10
lookup :: Ord key => key -> Map key elt -> Maybe elt
 
11
fromList :: Ord key => [(key,elt)] -> Map key elt
 
12
fromListWith :: Ord k => (a -> a -> a) -> [(k, a)] -> Map k a
 
13
toList :: Ord key => Map key elt -> [(key,elt)]
 
14
 
 
15
#if __GLASGOW_HASKELL__ < 604
 
16
type Map key elt = Map.FiniteMap key elt
 
17
 
 
18
lookup = flip Map.lookupFM
 
19
fromList = Map.listToFM 
 
20
fromListWith f xs = Map.addListToFM_C f Map.emptyFM xs
 
21
toList = Map.fmToList
 
22
 
 
23
#else
 
24
 
 
25
type Map key elt = Map.Map key elt
 
26
 
 
27
lookup = Map.lookup
 
28
fromList = Map.fromList
 
29
toList   = Map.toList
 
30
fromListWith = Map.fromListWith
 
31
 
 
32
#endif