reduceWith getMonadSum
>>> msumOf both ("hello","world") "helloworld"
>>> msumOf each (Nothing, Just "hello", Nothing) Just "hello"
msum ≡ msumOf 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
preview l (review l b) ≡ Just bbreaks 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?