File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed
Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff 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
212212Test 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
220220Test whether a value is not an element of a data structure.
Original file line number Diff line number Diff line change @@ -169,11 +169,11 @@ product :: forall a f. (Foldable f, Semiring a) => f a -> a
169169product = 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
173173elem = 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
177177notElem 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
187187lookup a f = runFirst $ foldMap (\(Tuple a' b) -> First (if a == a' then Just b else Nothing )) f
188188
189189foreign import foldrArray
You can’t perform that action at this time.
0 commit comments