definitive-base-2.6.3: A small Prelude wrapper to simplify my own Haskell developments

Safe HaskellNone
LanguageHaskell2010

Algebra.Foldable

Contents

Synopsis

Documentation

foldMap :: (Monoid m, Foldable t) => (a -> m) -> t a -> m Source #

convert :: (Unit f, Monoid (f a), Foldable t) => t a -> f a Source #

concat :: (Monoid m, Foldable t) => t m -> m Source #

sum :: (Monoid m, Foldable t) => t m -> m Source #

product :: (Ring m, Foldable t) => t m -> m Source #

nzsum :: Semigroup m => [m] -> m Source #

size :: (Foldable f, Ring n) => f a -> n Source #

length :: [a] -> Int Source #

maximum :: (Bounded a, Ord a, Foldable t) => t a -> a Source #

maximumBy :: (Ord a, Foldable t) => (b -> a) -> b -> t b -> b Source #

minimum :: (Bounded a, Ord a, Foldable t) => t a -> a Source #

minimumBy :: (Ord a, Foldable t) => (b -> a) -> b -> t b -> b Source #

sequence_ :: (Applicative f, Foldable t) => t (f a) -> f () Source #

traverse_ :: (Applicative f, Foldable t) => (a -> f b) -> t a -> f () Source #

for_ :: (Applicative f, Foldable t) => t a -> (a -> f b) -> f () Source #

split :: (Foldable t, Monoid b, Monoid c) => t (b :+: c) -> (b, c) Source #

partitionEithers :: (Foldable t, Unit t, Monoid (t a), Monoid (t b)) => t (a :+: b) -> (t a, t b) Source #

partition :: (Unit f, Monoid (f a), Foldable t) => (a -> Bool) -> t a -> (f a, f a) Source #

select :: (Unit f, Monoid (f a), Foldable t) => (a -> Bool) -> t a -> f a Source #

refuse :: (Unit f, Monoid (f a), Foldable t) => (a -> Bool) -> t a -> f a Source #

compose :: (Category k, Foldable t) => t (k a a) -> k a a Source #

composing :: (Category k, Foldable t) => (a -> k b b) -> t a -> k b b Source #

iter :: (Contravariant (k a), Category k, Foldable t) => k a (t (k a a) -> a) Source #

foldr :: Foldable t => (b -> a -> a) -> a -> t b -> a Source #

foldr1 :: (a -> a -> a) -> [a] -> a Source #

foldl' :: Foldable t => (a -> b -> a) -> a -> t b -> a Source #

foldl1' :: (a -> a -> a) -> [a] -> a Source #

toList :: Foldable t => t a -> [a] Source #

find :: Foldable t => (a -> Bool) -> t a -> Maybe a Source #

or :: Foldable t => t Bool -> Bool Source #

and :: Foldable t => t Bool -> Bool Source #

all :: Foldable t => (a -> Bool) -> t a -> Bool Source #

any :: Foldable t => (a -> Bool) -> t a -> Bool Source #

elem :: (Eq a, Foldable t) => a -> t a -> Bool Source #

empty :: Foldable f => f a -> Bool Source #

nonempty :: Foldable f => f a -> Bool Source #

intercalate :: (Monoid m, Foldable f) => m -> f m -> m Source #

interleave :: (Monoid m, Foldable f) => [m] -> f m -> m Source #

sizeTo :: Foldable f => Int -> f a -> Int Source #

Lazily counts the number of elements in a structure up to a certain size

Orphan instances

Unit Interleave Source # 

Methods

pure :: a -> Interleave a Source #

Foldable [] Source # 

Methods

fold :: Monoid m => [m] -> m Source #

Foldable Maybe Source # 

Methods

fold :: Monoid m => Maybe m -> m Source #

Foldable Tree Source # 

Methods

fold :: Monoid m => Tree m -> m Source #

Foldable Interleave Source # 

Methods

fold :: Monoid m => Interleave m -> m Source #

Foldable OrdList Source # 

Methods

fold :: Monoid m => OrdList m -> m Source #

Foldable Id Source # 

Methods

fold :: Monoid m => Id m -> m Source #

Foldable Strict Source # 

Methods

fold :: Monoid m => Strict m -> m Source #

Monad [] Source # 

Methods

join :: [[a]] -> [a] Source #

(>>=) :: [a] -> (a -> [b]) -> [b] Source #

Monad Maybe Source # 

Methods

join :: Maybe (Maybe a) -> Maybe a Source #

(>>=) :: Maybe a -> (a -> Maybe b) -> Maybe b Source #

Monad Interleave Source # 
Applicative [] Source # 
Applicative Maybe Source # 
Applicative Interleave Source # 
SemiApplicative [] Source # 

Methods

(<*>) :: [a -> b] -> [a] -> [b] Source #

SemiApplicative Maybe Source # 

Methods

(<*>) :: Maybe (a -> b) -> Maybe a -> Maybe b Source #

SemiApplicative Interleave Source # 

Methods

(<*>) :: Interleave (a -> b) -> Interleave a -> Interleave b Source #

(Foldable f, Semigroup (f a), Ring n) => SubSemi n (f a) Source # 

Methods

cast :: f a -> n Source #

Foldable (Either a) Source # 

Methods

fold :: Monoid m => Either a m -> m Source #

Foldable ((,) a) Source # 

Methods

fold :: Monoid m => (a, m) -> m Source #

Foldable (Assoc k) Source # 

Methods

fold :: Monoid m => Assoc k m -> m Source #

Foldable (Increasing k) Source # 

Methods

fold :: Monoid m => Increasing k m -> m Source #

(Foldable f, Foldable g) => Foldable ((:++:) f g) Source # 

Methods

fold :: Monoid m => (f :++: g) m -> m Source #

(Foldable f, Foldable g) => Foldable ((:**:) f g) Source # 

Methods

fold :: Monoid m => (f :**: g) m -> m Source #

(Foldable f, Foldable g) => Foldable ((:.:) f g) Source # 

Methods

fold :: Monoid m => (f :.: g) m -> m Source #