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

Remove Data.Set #14

Merged
merged 1 commit into from
Oct 30, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 0 additions & 39 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,45 +59,6 @@
values :: forall k v. Map k v -> [v]


## Module Data.Set

### Types

data Set a


### Type Class Instances

instance eqSet :: (P.Eq a) => P.Eq (Set a)

instance showSet :: (P.Show a) => P.Show (Set a)


### Values

checkValid :: forall a. Set a -> Boolean

delete :: forall a. (P.Ord a) => a -> Set a -> Set a

empty :: forall a. Set a

fromList :: forall a. (P.Ord a) => [a] -> Set a

insert :: forall a. (P.Ord a) => a -> Set a -> Set a

isEmpty :: forall a. Set a -> Boolean

member :: forall a. (P.Ord a) => a -> Set a -> Boolean

singleton :: forall a. a -> Set a

toList :: forall a. Set a -> [a]

union :: forall a. (P.Ord a) => Set a -> Set a -> Set a

unions :: forall a. (P.Ord a) => [Set a] -> Set a


## Module Data.StrMap

### Types
Expand Down
71 changes: 0 additions & 71 deletions src/Data/Set.purs

This file was deleted.

36 changes: 0 additions & 36 deletions tests/Data/Map.purs
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,10 @@ import Data.Foldable (foldl)
import Test.QuickCheck

import qualified Data.Map as M
import qualified Data.Set as S

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

instance arbSet :: (Eq a, Ord a, Arbitrary a) => Arbitrary (S.Set a) where
arbitrary = S.fromList <$> arbitrary

data SmallKey = A | B | C | D | E | F | G | H | I | J

instance showSmallKey :: Show SmallKey where
Expand Down Expand Up @@ -169,35 +165,3 @@ mapTests = do

trace "Union is idempotent"
quickCheck $ \m1 m2 -> (m1 `M.union` m2) == ((m1 `M.union` m2) `M.union` (m2 :: M.Map SmallKey Number))

-- Data.Set

trace "testMemberEmpty: member _ empty == false"
quickCheck $ \a -> S.member a (S.empty :: S.Set SmallKey) == false

trace "testMemberSingleton: member a (singleton a) == true"
quickCheck $ \a -> S.member (a :: SmallKey) (S.singleton a) == true

trace "testInsertDelete: member a (delete a (insert a empty) == false)"
quickCheck $ \a -> (S.member (a :: SmallKey) $
S.delete a $
S.insert a S.empty) == false

trace "testSingletonToList: toList (singleton a) == [a]"
quickCheck $ \a -> S.toList (S.singleton a :: S.Set SmallKey) == [a]

trace "testToListFromList: toList . fromList = id"
quickCheck $ \arr -> let f x = S.toList (S.fromList x) in
f (f arr) == f (arr :: [SmallKey])

trace "testFromListToList: fromList . toList = id"
quickCheck $ \s -> let f s = S.fromList (S.toList s) in
S.toList (f s) == S.toList (s :: S.Set SmallKey)

trace "testUnionSymmetric: union s1 s2 == union s2 s1"
quickCheck $ \s1 s2 -> let s3 = s1 `S.union` (s2 :: S.Set SmallKey) in
let s4 = s2 `S.union` s1 in
S.toList s3 == S.toList s4

trace "testUnionIdempotent"
quickCheck $ \s1 s2 -> (s1 `S.union` s2) == ((s1 `S.union` s2) `S.union` (s2 :: S.Set SmallKey))