Skip to content
This repository was archived by the owner on Oct 4, 2020. It is now read-only.

Commit 9bc374f

Browse files
committed
Remove unused imports
1 parent 5ea5faf commit 9bc374f

File tree

1 file changed

+25
-28
lines changed

1 file changed

+25
-28
lines changed

src/Data/Set.purs

Lines changed: 25 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -3,36 +3,33 @@
33
-- |
44
-- | Qualified import is encouraged, so as to avoid name clashes with other modules.
55

6-
module Data.Set
7-
( Set(),
8-
empty,
9-
isEmpty,
10-
singleton,
11-
checkValid,
12-
insert,
13-
member,
14-
delete,
15-
toList,
16-
fromList,
17-
size,
18-
union,
19-
unions,
20-
difference
6+
module Data.Set
7+
( Set()
8+
, empty
9+
, isEmpty
10+
, singleton
11+
, checkValid
12+
, insert
13+
, member
14+
, delete
15+
, toList
16+
, fromList
17+
, size
18+
, union
19+
, unions
20+
, difference
2121
) where
22-
22+
2323
import Prelude
24-
25-
import qualified Data.Map as M
2624

27-
import Data.Maybe
28-
import Data.Monoid
29-
import Data.Tuple
3025
import Data.Foldable (Foldable, foldMap, foldl, foldr)
31-
3226
import Data.List (List(..))
33-
27+
import Data.Monoid (Monoid)
28+
import Data.Tuple (fst)
29+
import qualified Data.Map as M
30+
3431
-- | `Set a` represents a set of values of type `a`
35-
data Set a = Set (M.Map a Unit)
32+
data Set a = Set (M.Map a Unit)
3633

3734
instance eqSet :: (Eq a) => Eq (Set a) where
3835
eq (Set m1) (Set m2) = m1 == m2
@@ -67,7 +64,7 @@ singleton :: forall a. a -> Set a
6764
singleton a = Set (M.singleton a unit)
6865

6966
-- | Check whether the underlying tree satisfies the 2-3 invariant
70-
-- |
67+
-- |
7168
-- | This function is provided for internal use.
7269
checkValid :: forall a. Set a -> Boolean
7370
checkValid (Set m) = M.checkValid m
@@ -79,11 +76,11 @@ member a (Set m) = a `M.member` m
7976
-- | Insert a value into a set
8077
insert :: forall a. (Ord a) => a -> Set a -> Set a
8178
insert a (Set m) = Set (M.insert a unit m)
82-
79+
8380
-- | Delete a value from a set
8481
delete :: forall a. (Ord a) => a -> Set a -> Set a
8582
delete a (Set m) = Set (a `M.delete` m)
86-
83+
8784
-- | Convert a set to a list
8885
toList :: forall a. Set a -> List a
8986
toList (Set m) = map fst (M.toList m)
@@ -97,7 +94,7 @@ size :: forall a. Set a -> Int
9794
size (Set m) = M.size m
9895

9996
-- | Form the union of two sets
100-
-- |
97+
-- |
10198
-- | Running time: `O(n * log(m))`
10299
union :: forall a. (Ord a) => Set a -> Set a -> Set a
103100
union (Set m1) (Set m2) = Set (m1 `M.union` m2)

0 commit comments

Comments
 (0)