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

Commit 6aa8c96

Browse files
committed
Merge pull request #14 from purescript-contrib/extract-set
Remove Data.Set
2 parents 4ffbca2 + 108bec0 commit 6aa8c96

File tree

3 files changed

+0
-146
lines changed

3 files changed

+0
-146
lines changed

README.md

-39
Original file line numberDiff line numberDiff line change
@@ -59,45 +59,6 @@
5959
values :: forall k v. Map k v -> [v]
6060

6161

62-
## Module Data.Set
63-
64-
### Types
65-
66-
data Set a
67-
68-
69-
### Type Class Instances
70-
71-
instance eqSet :: (P.Eq a) => P.Eq (Set a)
72-
73-
instance showSet :: (P.Show a) => P.Show (Set a)
74-
75-
76-
### Values
77-
78-
checkValid :: forall a. Set a -> Boolean
79-
80-
delete :: forall a. (P.Ord a) => a -> Set a -> Set a
81-
82-
empty :: forall a. Set a
83-
84-
fromList :: forall a. (P.Ord a) => [a] -> Set a
85-
86-
insert :: forall a. (P.Ord a) => a -> Set a -> Set a
87-
88-
isEmpty :: forall a. Set a -> Boolean
89-
90-
member :: forall a. (P.Ord a) => a -> Set a -> Boolean
91-
92-
singleton :: forall a. a -> Set a
93-
94-
toList :: forall a. Set a -> [a]
95-
96-
union :: forall a. (P.Ord a) => Set a -> Set a -> Set a
97-
98-
unions :: forall a. (P.Ord a) => [Set a] -> Set a
99-
100-
10162
## Module Data.StrMap
10263

10364
### Types

src/Data/Set.purs

-71
This file was deleted.

tests/Data/Map.purs

-36
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,10 @@ import Data.Foldable (foldl)
1111
import Test.QuickCheck
1212

1313
import qualified Data.Map as M
14-
import qualified Data.Set as S
1514

1615
instance arbMap :: (Eq k, Ord k, Arbitrary k, Arbitrary v) => Arbitrary (M.Map k v) where
1716
arbitrary = M.fromList <$> arbitrary
1817

19-
instance arbSet :: (Eq a, Ord a, Arbitrary a) => Arbitrary (S.Set a) where
20-
arbitrary = S.fromList <$> arbitrary
21-
2218
data SmallKey = A | B | C | D | E | F | G | H | I | J
2319

2420
instance showSmallKey :: Show SmallKey where
@@ -169,35 +165,3 @@ mapTests = do
169165

170166
trace "Union is idempotent"
171167
quickCheck $ \m1 m2 -> (m1 `M.union` m2) == ((m1 `M.union` m2) `M.union` (m2 :: M.Map SmallKey Number))
172-
173-
-- Data.Set
174-
175-
trace "testMemberEmpty: member _ empty == false"
176-
quickCheck $ \a -> S.member a (S.empty :: S.Set SmallKey) == false
177-
178-
trace "testMemberSingleton: member a (singleton a) == true"
179-
quickCheck $ \a -> S.member (a :: SmallKey) (S.singleton a) == true
180-
181-
trace "testInsertDelete: member a (delete a (insert a empty) == false)"
182-
quickCheck $ \a -> (S.member (a :: SmallKey) $
183-
S.delete a $
184-
S.insert a S.empty) == false
185-
186-
trace "testSingletonToList: toList (singleton a) == [a]"
187-
quickCheck $ \a -> S.toList (S.singleton a :: S.Set SmallKey) == [a]
188-
189-
trace "testToListFromList: toList . fromList = id"
190-
quickCheck $ \arr -> let f x = S.toList (S.fromList x) in
191-
f (f arr) == f (arr :: [SmallKey])
192-
193-
trace "testFromListToList: fromList . toList = id"
194-
quickCheck $ \s -> let f s = S.fromList (S.toList s) in
195-
S.toList (f s) == S.toList (s :: S.Set SmallKey)
196-
197-
trace "testUnionSymmetric: union s1 s2 == union s2 s1"
198-
quickCheck $ \s1 s2 -> let s3 = s1 `S.union` (s2 :: S.Set SmallKey) in
199-
let s4 = s2 `S.union` s1 in
200-
S.toList s3 == S.toList s4
201-
202-
trace "testUnionIdempotent"
203-
quickCheck $ \s1 s2 -> (s1 `S.union` s2) == ((s1 `S.union` s2) `S.union` (s2 :: S.Set SmallKey))

0 commit comments

Comments
 (0)