Data.Semigroup.Foldable

semigroupoids-1.2.6: Haskell 98 semigroupoids: Category sans id

Portability | portable
Stability | provisional
Maintainer | Edward Kmett <ekmett@gmail.com>

Data.Semigroup.Foldable

Description

Synopsis

- class Foldable t => Foldable1 t where
  - fold1 :: Semigroup m => t m -> m
  - foldMap1 :: Semigroup m => (a -> m) -> t a -> m
- traverse1_ :: (Foldable1 t, Apply f) => (a -> f b) -> t a -> f ()
- for1_ :: (Foldable1 t, Apply f) => t a -> (a -> f b) -> f ()
- sequenceA1_ :: (Foldable1 t, Apply f) => t (f a) -> f ()
- foldMapDefault1 :: (Foldable1 t, Monoid m) => (a -> m) -> t a -> m

# Documentation

class Foldable t => Foldable1 t where

Methods

fold1 :: Semigroup m => t m -> m

foldMap1 :: Semigroup m => (a -> m) -> t a -> m

Instances

Foldable1 Tree |
Foldable1 NonEmpty |
Foldable1 Identity |
Foldable1 m => Foldable1 (IdentityT m) |
(Foldable1 f, Foldable1 g) => Foldable1 (Compose f g) |
(Foldable1 f, Foldable1 g) => Foldable1 (Product f g) |

traverse1_ :: (Foldable1 t, Apply f) => (a -> f b) -> t a -> f ()

for1_ :: (Foldable1 t, Apply f) => t a -> (a -> f b) -> f ()

sequenceA1_ :: (Foldable1 t, Apply f) => t (f a) -> f ()

foldMapDefault1 :: (Foldable1 t, Monoid m) => (a -> m) -> t a -> m

Usable default for foldMap, but only if you define foldMap1 yourself