Skip to content

Commit 6190868

Browse files
committed
Reorder some constraints for consistency
1 parent ff603d2 commit 6190868

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,15 +206,15 @@ Find the product of the numeric values in a data structure.
206206
#### `elem`
207207

208208
``` purescript
209-
elem :: forall a f. (Eq a, Foldable f) => a -> f a -> Boolean
209+
elem :: forall a f. (Foldable f, Eq a) => a -> f a -> Boolean
210210
```
211211

212212
Test whether a value is an element of a data structure.
213213

214214
#### `notElem`
215215

216216
``` purescript
217-
notElem :: forall a f. (Eq a, Foldable f) => a -> f a -> Boolean
217+
notElem :: forall a f. (Foldable f, Eq a) => a -> f a -> Boolean
218218
```
219219

220220
Test whether a value is not an element of a data structure.

src/Data/Foldable.purs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -169,11 +169,11 @@ product :: forall a f. (Foldable f, Semiring a) => f a -> a
169169
product = foldl (*) one
170170

171171
-- | Test whether a value is an element of a data structure.
172-
elem :: forall a f. (Eq a, Foldable f) => a -> f a -> Boolean
172+
elem :: forall a f. (Foldable f, Eq a) => a -> f a -> Boolean
173173
elem = any <<< (==)
174174

175175
-- | Test whether a value is not an element of a data structure.
176-
notElem :: forall a f. (Eq a, Foldable f) => a -> f a -> Boolean
176+
notElem :: forall a f. (Foldable f, Eq a) => a -> f a -> Boolean
177177
notElem x = not <<< elem x
178178

179179
-- | Try to find an element in a data structure which satisfies a predicate.
@@ -183,7 +183,7 @@ find p f = case foldMap (\x -> if p x then [x] else []) f of
183183
[] -> Nothing
184184

185185
-- | Lookup a value in a data structure of `Tuple`s, generalizing association lists.
186-
lookup :: forall a b f. (Eq a, Foldable f) => a -> f (Tuple a b) -> Maybe b
186+
lookup :: forall a b f. (Foldable f, Eq a) => a -> f (Tuple a b) -> Maybe b
187187
lookup a f = runFirst $ foldMap (\(Tuple a' b) -> First (if a == a' then Just b else Nothing)) f
188188

189189
foreign import foldrArray

0 commit comments

Comments
 (0)