@@ -49,7 +49,7 @@ mkUniversalSet = mkFuzzySet (const top)
4949
5050==== __Examples__
5151
52- >>> let set = fromPairs [(1, 0.1), (2, 0.2), (3. 0.4)]
52+ >>> let set = fromList [(1, 0.1), (2, 0.2), (3. 0.4)]
5353>>> alphaCut 0.15 set
5454[2, 3]
5555
@@ -71,16 +71,16 @@ alphaCut alpha set = [x | x <- u, f x >= alpha]
7171
7272==== __Examples__
7373
74- >>> let set1 = fromPairs [(1, 0.2), (2, 0.7), (3, 0.1)] :: LSet Int UILukasiewicz
75- >>> let set2 = fromPairs [(1, 0.3), (2, 0.4)] :: LSet Int UILukasiewicz
76- >>> let set3 = fromPairs [(1, 0.5), (2, 0.1), (4, 0.8)] :: LSet Int UILukasiewicz
77- >>> toPairs $ union set1 set2
74+ >>> let set1 = fromList [(1, 0.2), (2, 0.7), (3, 0.1)] :: LSet Int UILukasiewicz
75+ >>> let set2 = fromList [(1, 0.3), (2, 0.4)] :: LSet Int UILukasiewicz
76+ >>> let set3 = fromList [(1, 0.5), (2, 0.1), (4, 0.8)] :: LSet Int UILukasiewicz
77+ >>> toList $ union set1 set2
7878[(1, 0.3),(2, 0.7), (3, 0.1)]
7979
80- >>> toPairs $ union set1 set3
80+ >>> toList $ union set1 set3
8181[(1, 0.5), (2, 0.7), (3, 0.1), (4, 0.8)]
8282
83- >>> toPairs $ union set1 mkEmptySet
83+ >>> toList $ union set1 mkEmptySet
8484[(1, 0.2), (2, 0.7), (3, 0.1)]
8585-}
8686union :: (FuzzySet set a l ) => set -> set -> set
@@ -99,16 +99,16 @@ unions sets@(set:_) = foldr union (mkUniversalSet (universe set)) sets
9999
100100==== __Examples__
101101
102- >>> let set1 = fromPairs [(1, 0.2), (2, 0.7), (3, 0.1)]
103- >>> let set2 = fromPairs [(1, 0.3), (2, 0.4)]
104- >>> let set3 = fromPairs [(1, 0.5), (2, 0.1), (4, 0.8)] :: LSet Int UILukasiewicz
105- >>> toPairs $ intersection set1 set2
102+ >>> let set1 = fromList [(1, 0.2), (2, 0.7), (3, 0.1)]
103+ >>> let set2 = fromList [(1, 0.3), (2, 0.4)]
104+ >>> let set3 = fromList [(1, 0.5), (2, 0.1), (4, 0.8)] :: LSet Int UILukasiewicz
105+ >>> toList $ intersection set1 set2
106106[(1, 0.2), (2, 0.4), (3, 0.0)]
107107
108- >>> toPairs $ intersection set1 set3
108+ >>> toList $ intersection set1 set3
109109[(1, 0.2), (2, 0.1), (3, 0.0), (4, 0.0)]
110110
111- >>> toPairs $ intersection set1 mkEmptySet
111+ >>> toList $ intersection set1 mkEmptySet
112112[(1, 0.0), (2, 0.0), (3, 0.0)]
113113-}
114114intersection :: (FuzzySet set a l ) => set -> set -> set
@@ -125,12 +125,12 @@ intersections = foldr intersection mkEmptySet
125125
126126==== __Examples__
127127
128- >>> let set1 = fromPairs [(1, 0.2), (2, 0.7)] :: LSet Int UILukasiewicz
129- >>> toPairs $ complement set1
128+ >>> let set1 = fromList [(1, 0.2), (2, 0.7)] :: LSet Int UILukasiewicz
129+ >>> toList $ complement set1
130130[(1, 0.8),(2, 0.3)]
131131
132- >>> let set2 = fromPairs [(1, 1), (2, 1)]
133- >>> toPairs $ complement set2
132+ >>> let set2 = fromList [(1, 1), (2, 1)]
133+ >>> toList $ complement set2
134134[(1, 0), (2, 0)]
135135-}
136136complement :: (FuzzySet set a l ) => set -> set
@@ -142,9 +142,9 @@ complement set = mkFuzzySet (negation . f) (universe set)
142142
143143==== __Examples__
144144
145- >>> let set1 = fromPairs [(1, 0.2), (2, 0.7)] :: LSet Int UILukasiewicz
146- >>> let set2 = fromPairs [(1, 0.3), (2, 0.4)] :: LSet Int UILukasiewicz
147- >>> toPairs $ setTnorm set1 set2
145+ >>> let set1 = fromList [(1, 0.2), (2, 0.7)] :: LSet Int UILukasiewicz
146+ >>> let set2 = fromList [(1, 0.3), (2, 0.4)] :: LSet Int UILukasiewicz
147+ >>> toList $ setTnorm set1 set2
148148[(1,0.2), (2,0.4)]
149149-}
150150setTnorm :: (FuzzySet set a l ) => set -> set -> set
@@ -158,9 +158,9 @@ setTnorm set1 set2 = mkFuzzySet (\x -> f x `tnorm` g x) u
158158
159159==== __Examples__
160160
161- >>> let set1 = fromPairs [(1, 0.2), (2, 0.7)] :: LSet Int UILukasiewicz
162- >>> let set2 = fromPairs [(1, 0.3), (2, 0.4)] :: LSet Int UILukasiewicz
163- >>> toPairs $ setResiduum set1 set2
161+ >>> let set1 = fromList [(1, 0.2), (2, 0.7)] :: LSet Int UILukasiewicz
162+ >>> let set2 = fromList [(1, 0.3), (2, 0.4)] :: LSet Int UILukasiewicz
163+ >>> toList $ setResiduum set1 set2
164164[(1,1.0), (2,0.7)]
165165-}
166166setResiduum :: (FuzzySet set a l ) => set -> set -> set
@@ -174,9 +174,9 @@ setResiduum set1 set2 = mkFuzzySet (\x -> f x --> g x) u
174174
175175==== __Examples__
176176
177- >>> let set = fromPairs [(1, 0.2), (2, 0.7)] :: LSet Int UILukasiewicz
177+ >>> let set = fromList [(1, 0.2), (2, 0.7)] :: LSet Int UILukasiewicz
178178>>> let modifiedSet = mapMembership set (\x -> x + 1)
179- >>> toPairs modifiedSet
179+ >>> toList modifiedSet
180180[(1,0.0),(2,0.0),(3,0.2)]
181181-}
182182mapMembership :: (FuzzySet set a l ) => set -> (a -> a ) -> set
@@ -190,9 +190,9 @@ mapMembership set g = mkFuzzySet (f . g) u
190190
191191==== __Examples__
192192
193- >>> let set = fromPairs [(1, 0.2), (2, 0.7), (3, 0.4)] :: LSet Int UILukasiewicz
193+ >>> let set = fromList [(1, 0.2), (2, 0.7), (3, 0.4)] :: LSet Int UILukasiewicz
194194>>> let filteredSet = filterMembership set (\x -> x > 1)
195- >>> toPairs filteredSet
195+ >>> toList filteredSet
196196[(1,0.0),(2,0.7),(3,0.4)]
197197-}
198198filterMembership :: (FuzzySet set a l ) => set -> (a -> Bool ) -> set
@@ -207,9 +207,9 @@ filterMembership set pred = mkFuzzySet h u
207207
208208==== __Examples__
209209
210- >>> let set = fromPairs [(1, 0.2), (2, 0.7)] :: LSet Int UILukasiewicz
210+ >>> let set = fromList [(1, 0.2), (2, 0.7)] :: LSet Int UILukasiewicz
211211>>> let modifiedSet = mapU set (\x -> x * 2)
212- >>> toPairs modifiedSet
212+ >>> toList modifiedSet
213213[(2,0.2),(4,0.7)]
214214-}
215215mapU :: (FuzzySet set a l ) => set -> (a -> a ) -> set
@@ -223,9 +223,9 @@ mapU set g = mkFuzzySet f u
223223
224224==== __Examples__
225225
226- >>> let set = fromPairs [(1, 0.2), (2, 0.7), (3, 0.4)] :: LSet Int UILukasiewicz
226+ >>> let set = fromList [(1, 0.2), (2, 0.7), (3, 0.4)] :: LSet Int UILukasiewicz
227227>>> let filteredSet = filterU set (\x -> x > 1)
228- >>> toPairs filteredSet
228+ >>> toList filteredSet
229229[(2,0.7),(3,0.4)]
230230-}
231231filterU :: (FuzzySet set a l ) => set -> (a -> Bool ) -> set
0 commit comments