msum

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.
Alias for biasum.
A dual of lensProduct: a prism sum. The law
preview l (review l b) ≡ Just b
breaks with
>>> let badPrism :: Prism' (Maybe Char) (Either Char Char); badPrism = prismSum _Just _Just

>>> preview badPrism (review badPrism (Right 'x'))
Just (Left 'x')
We put in Right value, but get back Left. Are you looking for without?
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.
Same as Sum, but with a user specified bit representation. For more info, see: Clash.Annotations.BitRepresentations.
This Haskell module exports various "from" functions for Either and Maybe.
Sum norm.