mono-traversable-1.0.17.0: Type classes for mapping, folding, and traversing monomorphic containers

Safe Haskell | None
Language | Haskell2010

Data.MonoTraversable.Unprefixed

Description

The functions in Data.MonoTraversable are all prefixed with the letter `o` to avoid conflicts with their polymorphic counterparts. This module exports the same identifiers without the prefix, for all cases where the monomorphic variant loses no generality versus the polymorphic version. For example, `olength` is just as general as `Data.Foldable.length`, so we export `length = length`. By contrast, `omap` cannot fully subsume `fmap` or `map`, so we do not provide such an export.

Since: 1.0.0

Synopsis

- foldMap :: (MonoFoldable mono, Monoid m) => (Element mono -> m) -> mono -> m
- foldr :: MonoFoldable mono => (Element mono -> b -> b) -> b -> mono -> b
- foldl' :: MonoFoldable mono => (a -> Element mono -> a) -> a -> mono -> a
- toList :: MonoFoldable mono => mono -> [Element mono]
- all :: MonoFoldable mono => (Element mono -> Bool) -> mono -> Bool
- any :: MonoFoldable mono => (Element mono -> Bool) -> mono -> Bool
- null :: MonoFoldable mono => mono -> Bool
- length :: MonoFoldable mono => mono -> Int
- length64 :: MonoFoldable mono => mono -> Int64
- compareLength :: (MonoFoldable mono, Integral i) => mono -> i -> Ordering
- traverse_ :: (MonoFoldable mono, Applicative f) => (Element mono -> f b) -> mono -> f ()
- for_ :: (MonoFoldable mono, Applicative f) => mono -> (Element mono -> f b) -> f ()
- mapM_ :: (MonoFoldable mono, Applicative m) => (Element mono -> m ()) -> mono -> m ()
- forM_ :: (MonoFoldable mono, Applicative m) => mono -> (Element mono -> m ()) -> m ()
- foldlM :: (MonoFoldable mono, Monad m) => (a -> Element mono -> m a) -> a -> mono -> m a
- foldMap1Ex :: (MonoFoldable mono, Semigroup m) => (Element mono -> m) -> mono -> m
- foldr1Ex :: MonoFoldable mono => (Element mono -> Element mono -> Element mono) -> mono -> Element mono
- foldl1Ex' :: MonoFoldable mono => (Element mono -> Element mono -> Element mono) -> mono -> Element mono
- sum :: (MonoFoldable mono, Num (Element mono)) => mono -> Element mono
- product :: (MonoFoldable mono, Num (Element mono)) => mono -> Element mono
- and :: (MonoFoldable mono, Element mono ~ Bool) => mono -> Bool
- or :: (MonoFoldable mono, Element mono ~ Bool) => mono -> Bool
- concatMap :: (MonoFoldable mono, Monoid m) => (Element mono -> m) -> mono -> m
- elem :: (MonoFoldable mono, Eq (Element mono)) => Element mono -> mono -> Bool
- notElem :: (MonoFoldable mono, Eq (Element mono)) => Element mono -> mono -> Bool
- point :: MonoPointed mono => Element mono -> mono
- intercalate :: (MonoFoldable mono, Monoid (Element mono)) => Element mono -> mono -> Element mono
- fold :: (MonoFoldable mono, Monoid (Element mono)) => mono -> Element mono
- concat :: (MonoFoldable mono, Monoid (Element mono)) => mono -> Element mono
- foldM :: (MonoFoldable mono, Monad m) => (a -> Element mono -> m a) -> a -> mono -> m a
- sequence_ :: (Applicative m, MonoFoldable mono, Element mono ~ m ()) => mono -> m ()

# Documentation

foldMap :: (MonoFoldable mono, Monoid m) => (Element mono -> m) -> mono -> m #

Synonym for `ofoldMap`

Since: 1.0.0

foldr :: MonoFoldable mono => (Element mono -> b -> b) -> b -> mono -> b #

Synonym for `ofoldr`

Since: 1.0.0

foldl' :: MonoFoldable mono => (a -> Element mono -> a) -> a -> mono -> a #

Synonym for `ofoldl'`

Since: 1.0.0

toList :: MonoFoldable mono => mono -> [Element mono] #

Synonym for `otoList`

Since: 1.0.0

all :: MonoFoldable mono => (Element mono -> Bool) -> mono -> Bool #

Synonym for `oall`

Since: 1.0.0

any :: MonoFoldable mono => (Element mono -> Bool) -> mono -> Bool #

Synonym for `oany`

Since: 1.0.0

null :: MonoFoldable mono => mono -> Bool #

Synonym for `onull`

Since: 1.0.0

length :: MonoFoldable mono => mono -> Int #

Synonym for `olength`

Since: 1.0.0

length64 :: MonoFoldable mono => mono -> Int64 #

Synonym for `olength64`

Since: 1.0.0

compareLength :: (MonoFoldable mono, Integral i) => mono -> i -> Ordering #

Synonym for `ocompareLength`

Since: 1.0.0

traverse_ :: (MonoFoldable mono, Applicative f) => (Element mono -> f b) -> mono -> f () #

Synonym for `otraverse_`

Since: 1.0.0

for_ :: (MonoFoldable mono, Applicative f) => mono -> (Element mono -> f b) -> f () #

Synonym for `ofor_`

Since: 1.0.0

mapM_ :: (MonoFoldable mono, Applicative m) => (Element mono -> m ()) -> mono -> m () #

Synonym for `omapM_`

Since: 1.0.0

forM_ :: (MonoFoldable mono, Applicative m) => mono -> (Element mono -> m ()) -> m () #

Synonym for `oforM_`

Since: 1.0.0

foldlM :: (MonoFoldable mono, Monad m) => (a -> Element mono -> m a) -> a -> mono -> m a #

Synonym for `ofoldlM`

Since: 1.0.0

foldMap1Ex :: (MonoFoldable mono, Semigroup m) => (Element mono -> m) -> mono -> m #

Synonym for `ofoldMap1Ex`

Since: 1.0.0

foldr1Ex :: MonoFoldable mono => (Element mono -> Element mono -> Element mono) -> mono -> Element mono #

Synonym for `ofoldr1Ex`

Since: 1.0.0

foldl1Ex' :: MonoFoldable mono => (Element mono -> Element mono -> Element mono) -> mono -> Element mono #

Synonym for `ofoldl1Ex'`

Since: 1.0.0

sum :: (MonoFoldable mono, Num (Element mono)) => mono -> Element mono #

Synonym for `osum`

Since: 1.0.0

product :: (MonoFoldable mono, Num (Element mono)) => mono -> Element mono #

Synonym for `oproduct`

Since: 1.0.0

and :: (MonoFoldable mono, Element mono ~ Bool) => mono -> Bool #

Synonym for `oand`

Since: 1.0.0

or :: (MonoFoldable mono, Element mono ~ Bool) => mono -> Bool #

Synonym for `oor`

Since: 1.0.0

concatMap :: (MonoFoldable mono, Monoid m) => (Element mono -> m) -> mono -> m #

Synonym for `oconcatMap`

Since: 1.0.0

elem :: (MonoFoldable mono, Eq (Element mono)) => Element mono -> mono -> Bool #

Synonym for `oelem`

Since: 1.0.0

notElem :: (MonoFoldable mono, Eq (Element mono)) => Element mono -> mono -> Bool #

Synonym for `onotElem`

Since: 1.0.0

point :: MonoPointed mono => Element mono -> mono #

Synonym for `opoint`

Since: 1.0.0

intercalate :: (MonoFoldable mono, Monoid (Element mono)) => Element mono -> mono -> Element mono #

Synonym for `ointercalate`

Since: 1.0.0

fold :: (MonoFoldable mono, Monoid (Element mono)) => mono -> Element mono #

Synonym for `ofold`

Since: 1.0.0

concat :: (MonoFoldable mono, Monoid (Element mono)) => mono -> Element mono #

Synonym for `oconcat`

Since: 1.0.0

foldM :: (MonoFoldable mono, Monad m) => (a -> Element mono -> m a) -> a -> mono -> m a #

Synonym for `ofoldM`

Since: 1.0.0

sequence_ :: (Applicative m, MonoFoldable mono, Element mono ~ m ()) => mono -> m () #

Synonym for `osequence_`

Since: 1.0.0