msum -package:lens

The sum of a collection of actions using (<|>), generalizing concat. msum is just like asum, but specialised to MonadPlus.

Examples

Basic usage, using the MonadPlus instance for Maybe:
>>> msum [Just "Hello", Nothing, Just "World"]
Just "Hello"
The sum of a collection of actions, generalizing concat. As of base 4.8.0.0, msum is just asum, specialized to MonadPlus.
The sum of a collection of actions, generalizing concat. msum is just like asum, but specialised to MonadPlus.
The sum of a collection of actions, generalizing concat
reduceWith getMonadSum
The sum of a collection of actions, generalizing concat. As of base 4.8.0.0, msum is just asum, specialized to MonadPlus.
The sum of a collection of actions, generalizing concatOf.
>>> msumOf both ("hello","world")
"helloworld"
>>> msumOf each (Nothing, Just "hello", Nothing)
Just "hello"
msummsumOf folded
msumOf :: MonadPlus m => Getter s (m a)     -> s -> m a
msumOf :: MonadPlus m => Fold s (m a)       -> s -> m a
msumOf :: MonadPlus m => Lens' s (m a)      -> s -> m a
msumOf :: MonadPlus m => Iso' s (m a)       -> s -> m a
msumOf :: MonadPlus m => Traversal' s (m a) -> s -> m a
msumOf :: MonadPlus m => Prism' s (m a)     -> s -> m a
The sum of a collection of actions.
>>> msumOf each ("hello","world")
"helloworld"
>>> msumOf each (Nothing, Just "hello", Nothing)
Just "hello"
msummsumOf folded
Fold a structure with >| (|<), thus always applying the input to the first (last) item for generation.
Try a list of monoidal actions in sequence, producing the index of the first successful action, and evaluating the action with the given index.
Fold a structure with >| (|<), thus always applying the input to the first (last) item for generation.
A description, or caption, for this media.
Alias for biasum.
An optional, string summary, intended to apply to all operations in this path.
Apply update functions to the terms and coefficients of a weighted sum.
This Haskell module exports various "from" functions for Either and Maybe.
sum
Sum norm.