aboutsummaryrefslogtreecommitdiff
path: root/src/Set.hs
blob: 383d23f87604072f6aa6bd133019a6c8ade1296a (plain) (blame)
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
module Set (
   Set,
   member,
   empty, singleton, delete,
   union, unions,
   elems, fromList
) where

import Data.Set 

#if __GLASGOW_HASKELL__ < 603
member :: Ord a => a -> Set a -> Bool
member = elementOf

empty  :: Set a
empty = emptySet

singleton :: a -> Set a
singleton  = unitSet

delete :: Ord a => a -> Set a -> Set a
delete = flip delFromSet

unions :: Ord a => [Set a] -> Set a
unions = unionManySets

elems :: Set a -> [a] 
elems = setToList

fromList :: Ord a => [a] -> Set a 
fromList = mkSet
#endif