squares-0.2: The double category of Hask functors and profunctors
LicenseBSD-style (see the file LICENSE)
Maintainersjoerd@w3future.com
Safe HaskellSafe-Inferred
LanguageHaskell2010

Data.Foldable.Square

Description

 
Synopsis

Documentation

foldMap :: (Foldable t, Monoid m, IsFList gs) => Square '[Forget m] '[Forget m] '[t] gs Source #

+--t--+
|  v  |
!m-@-!m
|  ?  |
+--?--+

foldMap as a square. Note that because Forget ignores its output parameter, this square can have any list of functors as output type.

any :: (Foldable t, IsFList gs) => Square '[Forget Bool] '[Forget Bool] '[t] gs Source #

any is foldMap specialized to Any.

all :: (Foldable t, IsFList gs) => Square '[Forget Bool] '[Forget Bool] '[t] gs Source #

all is foldMap specialized to All.

afoldMap :: (Foldable t, Alternative f) => Square '[Star f] '[Star f] '[t] '[] Source #

+--t--+
|  v  |
f>-@->f
|     |
+-----+

afoldMap is a mapping version of asum, or a generalization of concatMap.