HpcSet.hs 774 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
module HpcSet (	module HpcSet ) where 

import qualified Data.Set as Set

type Set a = Set.Set a

empty  :: Set a
insert :: (Ord a) => a -> Set a -> Set a
member :: (Ord a) => a -> Set a -> Bool
null   :: Set a -> Bool
intersection :: Ord a => Set a -> Set a -> Set a
fromList :: Ord a => [a] -> Set a
toList :: Set a -> [a]
union :: Ord a => Set a -> Set a -> Set a

#if __GLASGOW_HASKELL__ < 604

empty  = Set.emptySet
insert = flip Set.addToSet
member = Set.elementOf
null   = Set.isEmptySet
intersection = Set.intersect
fromList = Set.mkSet
toList = Set.setToList
union = Set.union

#else

empty  = Set.empty
insert = Set.insert
member = Set.member
null   = Set.null
intersection = Set.intersection
fromList = Set.fromList
toList = Set.toList
union = Set.union

#endif