@@ -34,11 +34,9 @@ module Data.Foldable
3434import Prelude
3535
3636import Control.Plus (class Plus , alt , empty )
37-
3837import Data.Maybe (Maybe (..))
3938import Data.Maybe.First (First (..))
4039import Data.Maybe.Last (Last (..))
41- import Data.Monoid (class Monoid , mempty )
4240import Data.Monoid.Additive (Additive (..))
4341import Data.Monoid.Conj (Conj (..))
4442import Data.Monoid.Disj (Disj (..))
@@ -173,7 +171,7 @@ instance foldableMultiplicative :: Foldable Multiplicative where
173171
174172-- | Fold a data structure, accumulating values in some `Monoid`.
175173fold :: forall f m . Foldable f => Monoid m => f m -> m
176- fold = foldMap id
174+ fold = foldMap identity
177175
178176-- | Similar to 'foldl', but the result is encapsulated in a monad.
179177-- |
@@ -230,7 +228,7 @@ for_ = flip traverse_
230228-- | sequence_ [ trace "Hello, ", trace " world!" ]
231229-- | ```
232230sequence_ :: forall a f m . Applicative m => Foldable f => f (m a ) -> m Unit
233- sequence_ = traverse_ id
231+ sequence_ = traverse_ identity
234232
235233-- | Combines a collection of elements using the `Alt` operation.
236234oneOf :: forall f g a . Foldable f => Plus g => f (g a ) -> g a
@@ -287,19 +285,19 @@ surroundMap d t f = unwrap (foldMap joined f) d
287285-- | = "*1*2*3*"
288286-- | ```
289287surround :: forall f m . Foldable f => Semigroup m => m -> f m -> m
290- surround d = surroundMap d id
288+ surround d = surroundMap d identity
291289
292290-- | The conjunction of all the values in a data structure. When specialized
293291-- | to `Boolean`, this function will test whether all of the values in a data
294292-- | structure are `true`.
295293and :: forall a f . Foldable f => HeytingAlgebra a => f a -> a
296- and = all id
294+ and = all identity
297295
298296-- | The disjunction of all the values in a data structure. When specialized
299297-- | to `Boolean`, this function will test whether any of the values in a data
300298-- | structure is `true`.
301299or :: forall a f . Foldable f => HeytingAlgebra a => f a -> a
302- or = any id
300+ or = any identity
303301
304302-- | `all f` is the same as `and <<< map f`; map a function over the structure,
305303-- | and then get the conjunction of the results.
0 commit comments