these-0.7.6: An either-or-both data type & a generalized 'zip with padding' typeclass

Safe Haskell | None
Language | Haskell2010

Control.Monad.Chronicle

Contents

- Type class for Chronicle-style monads
- The ChronicleT monad transformer

Description

The `ChronicleT` monad, a hybrid error/writer monad that allows both accumulating outputs and aborting computation with a final output.

Synopsis

- class Monad m => MonadChronicle c m | m -> c where
  - dictate :: c -> m ()
  - disclose :: Default a => c -> m a
  - confess :: c -> m a
  - memento :: m a -> m (Either c a)
  - absolve :: a -> m a -> m a
  - condemn :: m a -> m a
  - retcon :: (c -> c) -> m a -> m a
  - chronicle :: These c a -> m a
- type Chronicle c = ChronicleT c Identity
- runChronicle :: Chronicle c a -> These c a
- newtype ChronicleT c m a = ChronicleT {
  - runChronicleT :: m (These c a)
  }
- class Semigroup a => Monoid a where
  - mempty :: a
  - mappend :: a -> a -> a
  - mconcat :: [a] -> a

# Type class for Chronicle-style monads

class Monad m => MonadChronicle c m | m -> c where Source #

Minimal complete definition

dictate, confess, memento, absolve, condemn, retcon, chronicle

Methods

dictate :: c -> m () Source #

``dictate` c` is an action that records the output `c`.

Equivalent to `tell` for the `Writer` monad.

disclose :: Default a => c -> m a Source #

``disclose` c` is an action that records the output `c` and returns a ``Default`` value.

This is a convenience function for reporting non-fatal errors in one branch a `case`, or similar scenarios when there is no meaningful result but a placeholder of sorts is needed in order to continue.

confess :: c -> m a Source #

``confess` c` is an action that ends with a final record `c`.

Equivalent to `throwError` for the `Error` monad.

memento :: m a -> m (Either c a) Source #

``memento` m` is an action that executes the action `m`, returning either its record if it ended with `confess`, or its final value otherwise, with any record added to the current record.

Similar to `catchError` in the `Error` monad, but with a notion of non-fatal errors (which are accumulated) vs. fatal errors (which are caught without accumulating).

absolve :: a -> m a -> m a Source #

``absolve` x m` is an action that executes the action `m` and discards any record it had. The default value `x` will be used if `m` ended via `confess`.

condemn :: m a -> m a Source #

``condemn` m` is an action that executes the action `m` and keeps its value only if it had no record. Otherwise, the value (if any) will be discarded and only the record kept.

This can be seen as converting non-fatal errors into fatal ones.

retcon :: (c -> c) -> m a -> m a Source #

``retcon` f m` is an action that executes the action `m` and applies the function `f` to its output, leaving the return value unchanged.

Equivalent to `censor` for the `Writer` monad.

chronicle :: These c a -> m a Source #

``chronicle` m` lifts a plain 'These c a' value into a `MonadChronicle` instance.

Instances

MonadChronicle c m => MonadChronicle c (MaybeT m) Source # |

Instance details

Defined in Control.Monad.Chronicle.Class

Methods

dictate :: c -> MaybeT m () Source #

disclose :: Default a => c -> MaybeT m a Source #

confess :: c -> MaybeT m a Source #

memento :: MaybeT m a -> MaybeT m (Either c a) Source #

absolve :: a -> MaybeT m a -> MaybeT m a Source #

condemn :: MaybeT m a -> MaybeT m a Source #

retcon :: (c -> c) -> MaybeT m a -> MaybeT m a Source #

chronicle :: These c a -> MaybeT m a Source #

Semigroup c => MonadChronicle c (These c) Source # |

Instance details

Defined in Control.Monad.Chronicle.Class

Methods

dictate :: c -> These c () Source #

disclose :: Default a => c -> These c a Source #

confess :: c -> These c a Source #

memento :: These c a -> These c (Either c a) Source #

absolve :: a -> These c a -> These c a Source #

condemn :: These c a -> These c a Source #

retcon :: (c -> c) -> These c a -> These c a Source #

chronicle :: These c a -> These c a Source #

(Monoid w, MonadChronicle c m) => MonadChronicle c (WriterT w m) Source # |

Instance details

Defined in Control.Monad.Chronicle.Class

Methods

dictate :: c -> WriterT w m () Source #

disclose :: Default a => c -> WriterT w m a Source #

confess :: c -> WriterT w m a Source #

memento :: WriterT w m a -> WriterT w m (Either c a) Source #

absolve :: a -> WriterT w m a -> WriterT w m a Source #

condemn :: WriterT w m a -> WriterT w m a Source #

retcon :: (c -> c) -> WriterT w m a -> WriterT w m a Source #

chronicle :: These c a -> WriterT w m a Source #

(Monoid w, MonadChronicle c m) => MonadChronicle c (WriterT w m) Source # |

Instance details

Defined in Control.Monad.Chronicle.Class

Methods

dictate :: c -> WriterT w m () Source #

disclose :: Default a => c -> WriterT w m a Source #

confess :: c -> WriterT w m a Source #

memento :: WriterT w m a -> WriterT w m (Either c a) Source #

absolve :: a -> WriterT w m a -> WriterT w m a Source #

condemn :: WriterT w m a -> WriterT w m a Source #

retcon :: (c -> c) -> WriterT w m a -> WriterT w m a Source #

chronicle :: These c a -> WriterT w m a Source #

MonadChronicle c m => MonadChronicle c (StateT s m) Source # |

Instance details

Defined in Control.Monad.Chronicle.Class

Methods

dictate :: c -> StateT s m () Source #

disclose :: Default a => c -> StateT s m a Source #

confess :: c -> StateT s m a Source #

memento :: StateT s m a -> StateT s m (Either c a) Source #

absolve :: a -> StateT s m a -> StateT s m a Source #

condemn :: StateT s m a -> StateT s m a Source #

retcon :: (c -> c) -> StateT s m a -> StateT s m a Source #

chronicle :: These c a -> StateT s m a Source #

MonadChronicle c m => MonadChronicle c (StateT s m) Source # |

Instance details

Defined in Control.Monad.Chronicle.Class

Methods

dictate :: c -> StateT s m () Source #

disclose :: Default a => c -> StateT s m a Source #

confess :: c -> StateT s m a Source #

memento :: StateT s m a -> StateT s m (Either c a) Source #

absolve :: a -> StateT s m a -> StateT s m a Source #

condemn :: StateT s m a -> StateT s m a Source #

retcon :: (c -> c) -> StateT s m a -> StateT s m a Source #

chronicle :: These c a -> StateT s m a Source #

MonadChronicle c m => MonadChronicle c (ReaderT r m) Source # |

Instance details

Defined in Control.Monad.Chronicle.Class

Methods

dictate :: c -> ReaderT r m () Source #

disclose :: Default a => c -> ReaderT r m a Source #

confess :: c -> ReaderT r m a Source #

memento :: ReaderT r m a -> ReaderT r m (Either c a) Source #

absolve :: a -> ReaderT r m a -> ReaderT r m a Source #

condemn :: ReaderT r m a -> ReaderT r m a Source #

retcon :: (c -> c) -> ReaderT r m a -> ReaderT r m a Source #

chronicle :: These c a -> ReaderT r m a Source #

MonadChronicle c m => MonadChronicle c (ExceptT e m) Source # |

Instance details

Defined in Control.Monad.Chronicle.Class

Methods

dictate :: c -> ExceptT e m () Source #

disclose :: Default a => c -> ExceptT e m a Source #

confess :: c -> ExceptT e m a Source #

memento :: ExceptT e m a -> ExceptT e m (Either c a) Source #

absolve :: a -> ExceptT e m a -> ExceptT e m a Source #

condemn :: ExceptT e m a -> ExceptT e m a Source #

retcon :: (c -> c) -> ExceptT e m a -> ExceptT e m a Source #

chronicle :: These c a -> ExceptT e m a Source #

(Error e, MonadChronicle c m) => MonadChronicle c (ErrorT e m) Source # |

Instance details

Defined in Control.Monad.Chronicle.Class

Methods

dictate :: c -> ErrorT e m () Source #

disclose :: Default a => c -> ErrorT e m a Source #

confess :: c -> ErrorT e m a Source #

memento :: ErrorT e m a -> ErrorT e m (Either c a) Source #

absolve :: a -> ErrorT e m a -> ErrorT e m a Source #

condemn :: ErrorT e m a -> ErrorT e m a Source #

retcon :: (c -> c) -> ErrorT e m a -> ErrorT e m a Source #

chronicle :: These c a -> ErrorT e m a Source #

MonadChronicle c m => MonadChronicle c (IdentityT m) Source # |

Instance details

Defined in Control.Monad.Chronicle.Class

Methods

dictate :: c -> IdentityT m () Source #

disclose :: Default a => c -> IdentityT m a Source #

confess :: c -> IdentityT m a Source #

memento :: IdentityT m a -> IdentityT m (Either c a) Source #

absolve :: a -> IdentityT m a -> IdentityT m a Source #

condemn :: IdentityT m a -> IdentityT m a Source #

retcon :: (c -> c) -> IdentityT m a -> IdentityT m a Source #

chronicle :: These c a -> IdentityT m a Source #

(Semigroup c, Monad m) => MonadChronicle c (ChronicleT c m) Source # |

Instance details

Defined in Control.Monad.Chronicle.Class

Methods

dictate :: c -> ChronicleT c m () Source #

disclose :: Default a => c -> ChronicleT c m a Source #

confess :: c -> ChronicleT c m a Source #

memento :: ChronicleT c m a -> ChronicleT c m (Either c a) Source #

absolve :: a -> ChronicleT c m a -> ChronicleT c m a Source #

condemn :: ChronicleT c m a -> ChronicleT c m a Source #

retcon :: (c -> c) -> ChronicleT c m a -> ChronicleT c m a Source #

chronicle :: These c a -> ChronicleT c m a Source #

(Monoid w, MonadChronicle c m) => MonadChronicle c (RWST r w s m) Source # |

Instance details

Defined in Control.Monad.Chronicle.Class

Methods

dictate :: c -> RWST r w s m () Source #

disclose :: Default a => c -> RWST r w s m a Source #

confess :: c -> RWST r w s m a Source #

memento :: RWST r w s m a -> RWST r w s m (Either c a) Source #

absolve :: a -> RWST r w s m a -> RWST r w s m a Source #

condemn :: RWST r w s m a -> RWST r w s m a Source #

retcon :: (c -> c) -> RWST r w s m a -> RWST r w s m a Source #

chronicle :: These c a -> RWST r w s m a Source #

(Monoid w, MonadChronicle c m) => MonadChronicle c (RWST r w s m) Source # |

Instance details

Defined in Control.Monad.Chronicle.Class

Methods

dictate :: c -> RWST r w s m () Source #

disclose :: Default a => c -> RWST r w s m a Source #

confess :: c -> RWST r w s m a Source #

memento :: RWST r w s m a -> RWST r w s m (Either c a) Source #

absolve :: a -> RWST r w s m a -> RWST r w s m a Source #

condemn :: RWST r w s m a -> RWST r w s m a Source #

retcon :: (c -> c) -> RWST r w s m a -> RWST r w s m a Source #

chronicle :: These c a -> RWST r w s m a Source #

# The ChronicleT monad transformer

type Chronicle c = ChronicleT c Identity Source #

A chronicle monad parameterized by the output type `c`.

The `return` function produces a computation with no output, and `>>=` combines multiple outputs with `mappend`.

runChronicle :: Chronicle c a -> These c a Source #

newtype ChronicleT c m a Source #

The `ChronicleT` monad transformer.

The `return` function produces a computation with no output, and `>>=` combines multiple outputs with `mappend`.

Constructors

ChronicleT |

Fields

- runChronicleT :: m (These c a)

Instances

(Semigroup c, MonadRWS r w s m) => MonadRWS r w s (ChronicleT c m) Source # |
Instance details Defined in Control.Monad.Trans.Chronicle
(Semigroup c, MonadError e m) => MonadError e (ChronicleT c m) Source # |
Instance details Defined in Control.Monad.Trans.Chronicle Methods throwError :: e -> ChronicleT c m a catchError :: ChronicleT c m a -> (e -> ChronicleT c m a) -> ChronicleT c m a
(Semigroup c, MonadReader r m) => MonadReader r (ChronicleT c m) Source # |
Instance details Defined in Control.Monad.Trans.Chronicle Methods ask :: ChronicleT c m r local :: (r -> r) -> ChronicleT c m a -> ChronicleT c m a reader :: (r -> a) -> ChronicleT c m a
(Semigroup c, MonadWriter w m) => MonadWriter w (ChronicleT c m) Source # |
Instance details Defined in Control.Monad.Trans.Chronicle Methods writer :: (a, w) -> ChronicleT c m a tell :: w -> ChronicleT c m () listen :: ChronicleT c m a -> ChronicleT c m (a, w) pass :: ChronicleT c m (a, w -> w) -> ChronicleT c m a
(Semigroup c, MonadState s m) => MonadState s (ChronicleT c m) Source # |
Instance details Defined in Control.Monad.Trans.Chronicle Methods get :: ChronicleT c m s put :: s -> ChronicleT c m () state :: (s -> (a, s)) -> ChronicleT c m a
(Semigroup c, Monad m) => MonadChronicle c (ChronicleT c m) Source # |

Instance details

Defined in Control.Monad.Chronicle.Class

Methods

dictate :: c -> ChronicleT c m () Source #

disclose :: Default a => c -> ChronicleT c m a Source #

confess :: c -> ChronicleT c m a Source #

memento :: ChronicleT c m a -> ChronicleT c m (Either c a) Source #

absolve :: a -> ChronicleT c m a -> ChronicleT c m a Source #

condemn :: ChronicleT c m a -> ChronicleT c m a Source #

retcon :: (c -> c) -> ChronicleT c m a -> ChronicleT c m a Source #

chronicle :: These c a -> ChronicleT c m a Source #

Semigroup c => MonadTrans (ChronicleT c) Source # |
Instance details Defined in Control.Monad.Trans.Chronicle Methods lift :: Monad m => m a -> ChronicleT c m a
(Semigroup c, Monad m) => Monad (ChronicleT c m) Source # |
Instance details Defined in Control.Monad.Trans.Chronicle Methods (>>=) :: ChronicleT c m a -> (a -> ChronicleT c m b) -> ChronicleT c m b # (>>) :: ChronicleT c m a -> ChronicleT c m b -> ChronicleT c m b # return :: a -> ChronicleT c m a # fail :: String -> ChronicleT c m a #
Functor m => Functor (ChronicleT c m) Source # |
Instance details Defined in Control.Monad.Trans.Chronicle Methods fmap :: (a -> b) -> ChronicleT c m a -> ChronicleT c m b # (<$) :: a -> ChronicleT c m b -> ChronicleT c m a #
(Semigroup c, MonadFix m) => MonadFix (ChronicleT c m) Source # |
Instance details Defined in Control.Monad.Trans.Chronicle Methods mfix :: (a -> ChronicleT c m a) -> ChronicleT c m a
(Semigroup c, Applicative m) => Applicative (ChronicleT c m) Source # |
Instance details Defined in Control.Monad.Trans.Chronicle Methods pure :: a -> ChronicleT c m a (<*>) :: ChronicleT c m (a -> b) -> ChronicleT c m a -> ChronicleT c m b liftA2 :: (a -> b -> c0) -> ChronicleT c m a -> ChronicleT c m b -> ChronicleT c m c0 (*>) :: ChronicleT c m a -> ChronicleT c m b -> ChronicleT c m b (<*) :: ChronicleT c m a -> ChronicleT c m b -> ChronicleT c m a
(Semigroup c, MonadIO m) => MonadIO (ChronicleT c m) Source # |
Instance details Defined in Control.Monad.Trans.Chronicle Methods liftIO :: IO a -> ChronicleT c m a
(Semigroup c, Monoid c, Monad m) => MonadPlus (ChronicleT c m) Source # |
Instance details Defined in Control.Monad.Trans.Chronicle Methods mzero :: ChronicleT c m a # mplus :: ChronicleT c m a -> ChronicleT c m a -> ChronicleT c m a #
(Semigroup c, Monoid c, Applicative m, Monad m) => Alternative (ChronicleT c m) Source # |
Instance details Defined in Control.Monad.Trans.Chronicle Methods empty :: ChronicleT c m a (<|>) :: ChronicleT c m a -> ChronicleT c m a -> ChronicleT c m a some :: ChronicleT c m a -> ChronicleT c m [a] many :: ChronicleT c m a -> ChronicleT c m [a]
(Semigroup c, Apply m) => Apply (ChronicleT c m) Source # |
Instance details Defined in Control.Monad.Trans.Chronicle Methods (<.>) :: ChronicleT c m (a -> b) -> ChronicleT c m a -> ChronicleT c m b Source # (.>) :: ChronicleT c m a -> ChronicleT c m b -> ChronicleT c m b Source # (<.) :: ChronicleT c m a -> ChronicleT c m b -> ChronicleT c m a Source # liftF2 :: (a -> b -> c0) -> ChronicleT c m a -> ChronicleT c m b -> ChronicleT c m c0 Source #
(Semigroup c, Apply m, Monad m) => Bind (ChronicleT c m) Source # |
Instance details Defined in Control.Monad.Trans.Chronicle Methods (>>-) :: ChronicleT c m a -> (a -> ChronicleT c m b) -> ChronicleT c m b Source # join :: ChronicleT c m (ChronicleT c m a) -> ChronicleT c m a Source #

class Semigroup a => Monoid a where #

Minimal complete definition

mempty

Methods

mempty :: a #

mappend :: a -> a -> a #

mconcat :: [a] -> a #

Instances

Monoid Ordering |
Instance details Defined in GHC.Base Methods mempty :: Ordering # mappend :: Ordering -> Ordering -> Ordering # mconcat :: [Ordering] -> Ordering #
Monoid () |
Instance details Defined in GHC.Base Methods mempty :: () # mappend :: () -> () -> () # mconcat :: [()] -> () #
Monoid ByteString |
Instance details Defined in Data.ByteString.Internal Methods mempty :: ByteString # mappend :: ByteString -> ByteString -> ByteString # mconcat :: [ByteString] -> ByteString #
Monoid ByteString |
Instance details Defined in Data.ByteString.Lazy.Internal Methods mempty :: ByteString # mappend :: ByteString -> ByteString -> ByteString # mconcat :: [ByteString] -> ByteString #
Monoid Builder |
Instance details Defined in Data.ByteString.Builder.Internal Methods mempty :: Builder # mappend :: Builder -> Builder -> Builder # mconcat :: [Builder] -> Builder #
Monoid Series |
Instance details Defined in Data.Aeson.Encoding.Internal Methods mempty :: Series # mappend :: Series -> Series -> Series # mconcat :: [Series] -> Series #
Monoid Any |
Instance details Defined in Data.Semigroup.Internal Methods mempty :: Any # mappend :: Any -> Any -> Any # mconcat :: [Any] -> Any #
Monoid All |
Instance details Defined in Data.Semigroup.Internal Methods mempty :: All # mappend :: All -> All -> All # mconcat :: [All] -> All #
Monoid IntSet |
Instance details Defined in Data.IntSet.Internal Methods mempty :: IntSet # mappend :: IntSet -> IntSet -> IntSet # mconcat :: [IntSet] -> IntSet #
Monoid More |
Instance details Defined in Data.Attoparsec.Internal.Types Methods mempty :: More # mappend :: More -> More -> More # mconcat :: [More] -> More #
Monoid Doc |
Instance details Defined in Text.PrettyPrint.HughesPJ Methods mempty :: Doc # mappend :: Doc -> Doc -> Doc # mconcat :: [Doc] -> Doc #
Monoid ByteArray |
Instance details Defined in Data.Primitive.ByteArray Methods mempty :: ByteArray # mappend :: ByteArray -> ByteArray -> ByteArray # mconcat :: [ByteArray] -> ByteArray #
Monoid ShortByteString |
Instance details Defined in Data.ByteString.Short.Internal Methods mempty :: ShortByteString # mappend :: ShortByteString -> ShortByteString -> ShortByteString # mconcat :: [ShortByteString] -> ShortByteString #
Monoid [a] |
Instance details Defined in GHC.Base Methods mempty :: [a] # mappend :: [a] -> [a] -> [a] # mconcat :: [[a]] -> [a] #
Semigroup a => Monoid (Maybe a) |
Instance details Defined in GHC.Base Methods mempty :: Maybe a # mappend :: Maybe a -> Maybe a -> Maybe a # mconcat :: [Maybe a] -> Maybe a #
Monoid a => Monoid (IO a) |
Instance details Defined in GHC.Base Methods mempty :: IO a # mappend :: IO a -> IO a -> IO a # mconcat :: [IO a] -> IO a #
Monoid p => Monoid (Par1 p) |
Instance details Defined in GHC.Generics Methods mempty :: Par1 p # mappend :: Par1 p -> Par1 p -> Par1 p # mconcat :: [Par1 p] -> Par1 p #
Monoid (IResult a) |
Instance details Defined in Data.Aeson.Types.Internal Methods mempty :: IResult a # mappend :: IResult a -> IResult a -> IResult a # mconcat :: [IResult a] -> IResult a #
Monoid (Result a) |
Instance details Defined in Data.Aeson.Types.Internal Methods mempty :: Result a # mappend :: Result a -> Result a -> Result a # mconcat :: [Result a] -> Result a #
Monoid (Parser a) |
Instance details Defined in Data.Aeson.Types.Internal Methods mempty :: Parser a # mappend :: Parser a -> Parser a -> Parser a # mconcat :: [Parser a] -> Parser a #
Monoid a => Monoid (Identity a) |
Instance details Defined in Data.Functor.Identity Methods mempty :: Identity a # mappend :: Identity a -> Identity a -> Identity a # mconcat :: [Identity a] -> Identity a #
Num a => Monoid (Product a) |
Instance details Defined in Data.Semigroup.Internal Methods mempty :: Product a # mappend :: Product a -> Product a -> Product a # mconcat :: [Product a] -> Product a #
Num a => Monoid (Sum a) |
Instance details Defined in Data.Semigroup.Internal Methods mempty :: Sum a # mappend :: Sum a -> Sum a -> Sum a # mconcat :: [Sum a] -> Sum a #
Monoid (Endo a) |
Instance details Defined in Data.Semigroup.Internal Methods mempty :: Endo a # mappend :: Endo a -> Endo a -> Endo a # mconcat :: [Endo a] -> Endo a #
Monoid a => Monoid (Dual a) |
Instance details Defined in Data.Semigroup.Internal Methods mempty :: Dual a # mappend :: Dual a -> Dual a -> Dual a # mconcat :: [Dual a] -> Dual a #
Monoid (Last a) |
Instance details Defined in Data.Monoid Methods mempty :: Last a # mappend :: Last a -> Last a -> Last a # mconcat :: [Last a] -> Last a #
Monoid (First a) |
Instance details Defined in Data.Monoid Methods mempty :: First a # mappend :: First a -> First a -> First a # mconcat :: [First a] -> First a #
Semigroup a => Monoid (Option a) |
Instance details Defined in Data.Semigroup Methods mempty :: Option a # mappend :: Option a -> Option a -> Option a # mconcat :: [Option a] -> Option a #
Monoid m => Monoid (WrappedMonoid m) |
Instance details Defined in Data.Semigroup Methods mempty :: WrappedMonoid m # mappend :: WrappedMonoid m -> WrappedMonoid m -> WrappedMonoid m # mconcat :: [WrappedMonoid m] -> WrappedMonoid m #
(Ord a, Bounded a) => Monoid (Max a) |
Instance details Defined in Data.Semigroup Methods mempty :: Max a # mappend :: Max a -> Max a -> Max a # mconcat :: [Max a] -> Max a #
(Ord a, Bounded a) => Monoid (Min a) |
Instance details Defined in Data.Semigroup Methods mempty :: Min a # mappend :: Min a -> Min a -> Min a # mconcat :: [Min a] -> Min a #
Prim a => Monoid (Vector a) |
Instance details Defined in Data.Vector.Primitive Methods mempty :: Vector a # mappend :: Vector a -> Vector a -> Vector a # mconcat :: [Vector a] -> Vector a #
Storable a => Monoid (Vector a) |
Instance details Defined in Data.Vector.Storable Methods mempty :: Vector a # mappend :: Vector a -> Vector a -> Vector a # mconcat :: [Vector a] -> Vector a #
Ord a => Monoid (Set a) |
Instance details Defined in Data.Set.Internal Methods mempty :: Set a # mappend :: Set a -> Set a -> Set a # mconcat :: [Set a] -> Set a #
(Hashable a, Eq a) => Monoid (HashSet a) |
Instance details Defined in Data.HashSet.Base Methods mempty :: HashSet a # mappend :: HashSet a -> HashSet a -> HashSet a # mconcat :: [HashSet a] -> HashSet a #
Monoid (Vector a) |
Instance details Defined in Data.Vector Methods mempty :: Vector a # mappend :: Vector a -> Vector a -> Vector a # mconcat :: [Vector a] -> Vector a #
Monoid (Seq a) |
Instance details Defined in Data.Sequence.Internal Methods mempty :: Seq a # mappend :: Seq a -> Seq a -> Seq a # mconcat :: [Seq a] -> Seq a #
Monoid (IntMap a) |
Instance details Defined in Data.IntMap.Internal Methods mempty :: IntMap a # mappend :: IntMap a -> IntMap a -> IntMap a # mconcat :: [IntMap a] -> IntMap a #
Monoid a => Monoid (Down a) |
Instance details Defined in Data.Ord Methods mempty :: Down a # mappend :: Down a -> Down a -> Down a # mconcat :: [Down a] -> Down a #
Monoid (PutM ()) |
Instance details Defined in Data.Binary.Put Methods mempty :: PutM () # mappend :: PutM () -> PutM () -> PutM () # mconcat :: [PutM ()] -> PutM () #
Monoid (Doc a) |
Instance details Defined in Text.PrettyPrint.Annotated.HughesPJ Methods mempty :: Doc a # mappend :: Doc a -> Doc a -> Doc a # mconcat :: [Doc a] -> Doc a #
Monoid (Array a) |
Instance details Defined in Data.Primitive.Array Methods mempty :: Array a # mappend :: Array a -> Array a -> Array a # mconcat :: [Array a] -> Array a #
Monoid (DList a) |
Instance details Defined in Data.DList Methods mempty :: DList a # mappend :: DList a -> DList a -> DList a # mconcat :: [DList a] -> DList a #
Monoid (PrimArray a) |
Instance details Defined in Data.Primitive.PrimArray Methods mempty :: PrimArray a # mappend :: PrimArray a -> PrimArray a -> PrimArray a # mconcat :: [PrimArray a] -> PrimArray a #
Monoid (SmallArray a) |
Instance details Defined in Data.Primitive.SmallArray Methods mempty :: SmallArray a # mappend :: SmallArray a -> SmallArray a -> SmallArray a # mconcat :: [SmallArray a] -> SmallArray a #
PrimUnlifted a => Monoid (UnliftedArray a) |
Instance details Defined in Data.Primitive.UnliftedArray Methods mempty :: UnliftedArray a # mappend :: UnliftedArray a -> UnliftedArray a -> UnliftedArray a # mconcat :: [UnliftedArray a] -> UnliftedArray a #
Monoid (MergeSet a) |
Instance details Defined in Data.Set.Internal Methods mempty :: MergeSet a # mappend :: MergeSet a -> MergeSet a -> MergeSet a # mconcat :: [MergeSet a] -> MergeSet a #
Monoid b => Monoid (a -> b) |
Instance details Defined in GHC.Base Methods mempty :: a -> b # mappend :: (a -> b) -> (a -> b) -> a -> b # mconcat :: [a -> b] -> a -> b #
Monoid (U1 p) |
Instance details Defined in GHC.Generics Methods mempty :: U1 p # mappend :: U1 p -> U1 p -> U1 p # mconcat :: [U1 p] -> U1 p #
(Monoid a, Monoid b) => Monoid (a, b) |
Instance details Defined in GHC.Base Methods mempty :: (a, b) # mappend :: (a, b) -> (a, b) -> (a, b) # mconcat :: [(a, b)] -> (a, b) #
(Eq k, Hashable k) => Monoid (HashMap k v) |
Instance details Defined in Data.HashMap.Base Methods mempty :: HashMap k v # mappend :: HashMap k v -> HashMap k v -> HashMap k v # mconcat :: [HashMap k v] -> HashMap k v #
Ord k => Monoid (Map k v) |
Instance details Defined in Data.Map.Internal Methods mempty :: Map k v # mappend :: Map k v -> Map k v -> Map k v # mconcat :: [Map k v] -> Map k v #
Monoid (Proxy s) |
Instance details Defined in Data.Proxy Methods mempty :: Proxy s # mappend :: Proxy s -> Proxy s -> Proxy s # mconcat :: [Proxy s] -> Proxy s #
Monoid (ReifiedFold s a) |
Instance details Defined in Control.Lens.Reified Methods mempty :: ReifiedFold s a # mappend :: ReifiedFold s a -> ReifiedFold s a -> ReifiedFold s a # mconcat :: [ReifiedFold s a] -> ReifiedFold s a #
Monoid (Deepening i a) | This is an illegal `Monoid`.
Instance details Defined in Control.Lens.Internal.Level Methods mempty :: Deepening i a # mappend :: Deepening i a -> Deepening i a -> Deepening i a # mconcat :: [Deepening i a] -> Deepening i a #

Monoid (f a) => Monoid (Indexing f a)

    >>> "cat" ^@.. (folded <> folded)
    [(0,'c'),(1,'a'),(2,'t'),(0,'c'),(1,'a'),(2,'t')]

    >>> "cat" ^@.. indexing (folded <> folded)
    [(0,'c'),(1,'a'),(2,'t'),(3,'c'),(4,'a'),(5,'t')]

Instance details Defined in Control.Lens.Internal.Indexed Methods mempty :: Indexing f a # mappend :: Indexing f a -> Indexing f a -> Indexing f a # mconcat :: [Indexing f a] -> Indexing f a #
Monoid (Parser i a) |
Instance details Defined in Data.Attoparsec.Internal.Types Methods mempty :: Parser i a # mappend :: Parser i a -> Parser i a -> Parser i a # mconcat :: [Parser i a] -> Parser i a #
Monoid a => Monoid (ST s a) |
Instance details Defined in GHC.ST Methods mempty :: ST s a # mappend :: ST s a -> ST s a -> ST s a # mconcat :: [ST s a] -> ST s a #
Monoid (f p) => Monoid (Rec1 f p) |
Instance details Defined in GHC.Generics Methods mempty :: Rec1 f p # mappend :: Rec1 f p -> Rec1 f p -> Rec1 f p # mconcat :: [Rec1 f p] -> Rec1 f p #
(Monoid a, Monoid b, Monoid c) => Monoid (a, b, c) |
Instance details Defined in GHC.Base Methods mempty :: (a, b, c) # mappend :: (a, b, c) -> (a, b, c) -> (a, b, c) # mconcat :: [(a, b, c)] -> (a, b, c) #
Alternative f => Monoid (Alt f a) |
Instance details Defined in Data.Semigroup.Internal Methods mempty :: Alt f a # mappend :: Alt f a -> Alt f a -> Alt f a # mconcat :: [Alt f a] -> Alt f a #
(Applicative f, Monoid a) => Monoid (Ap f a) |
Instance details Defined in Data.Monoid Methods mempty :: Ap f a # mappend :: Ap f a -> Ap f a -> Ap f a # mconcat :: [Ap f a] -> Ap f a #
Monoid a => Monoid (Const a b) |
Instance details Defined in Data.Functor.Const Methods mempty :: Const a b # mappend :: Const a b -> Const a b -> Const a b # mconcat :: [Const a b] -> Const a b #
Monoid (ReifiedIndexedFold i s a) |
Instance details Defined in Control.Lens.Reified Methods mempty :: ReifiedIndexedFold i s a # mappend :: ReifiedIndexedFold i s a -> ReifiedIndexedFold i s a -> ReifiedIndexedFold i s a # mconcat :: [ReifiedIndexedFold i s a] -> ReifiedIndexedFold i s a #
(Semigroup a, Monoid a) => Monoid (Tagged s a) |
Instance details Defined in Data.Tagged Methods mempty :: Tagged s a # mappend :: Tagged s a -> Tagged s a -> Tagged s a # mconcat :: [Tagged s a] -> Tagged s a #
Monoid a => Monoid (Constant a b) |
Instance details Defined in Data.Functor.Constant Methods mempty :: Constant a b # mappend :: Constant a b -> Constant a b -> Constant a b # mconcat :: [Constant a b] -> Constant a b #
Reifies s (ReifiedMonoid a) => Monoid (ReflectedMonoid a s) |
Instance details Defined in Data.Reflection Methods mempty :: ReflectedMonoid a s # mappend :: ReflectedMonoid a s -> ReflectedMonoid a s -> ReflectedMonoid a s # mconcat :: [ReflectedMonoid a s] -> ReflectedMonoid a s #
ArrowPlus p => Monoid (Tambara p a b) |
Instance details Defined in Data.Profunctor.Strong Methods mempty :: Tambara p a b # mappend :: Tambara p a b -> Tambara p a b -> Tambara p a b # mconcat :: [Tambara p a b] -> Tambara p a b #
Monoid c => Monoid (K1 i c p) |
Instance details Defined in GHC.Generics Methods mempty :: K1 i c p # mappend :: K1 i c p -> K1 i c p -> K1 i c p # mconcat :: [K1 i c p] -> K1 i c p #
(Monoid (f p), Monoid (g p)) => Monoid ((f :*: g) p) |
Instance details Defined in GHC.Generics Methods mempty :: (f :*: g) p # mappend :: (f :*: g) p -> (f :*: g) p -> (f :*: g) p # mconcat :: [(f :*: g) p] -> (f :*: g) p #
(Monoid a, Monoid b, Monoid c, Monoid d) => Monoid (a, b, c, d) |
Instance details Defined in GHC.Base Methods mempty :: (a, b, c, d) # mappend :: (a, b, c, d) -> (a, b, c, d) -> (a, b, c, d) # mconcat :: [(a, b, c, d)] -> (a, b, c, d) #
Monoid (f p) => Monoid (M1 i c f p) |
Instance details Defined in GHC.Generics Methods mempty :: M1 i c f p # mappend :: M1 i c f p -> M1 i c f p -> M1 i c f p # mconcat :: [M1 i c f p] -> M1 i c f p #
Monoid (f (g p)) => Monoid ((f :.: g) p) |
Instance details Defined in GHC.Generics Methods mempty :: (f :.: g) p # mappend :: (f :.: g) p -> (f :.: g) p -> (f :.: g) p # mconcat :: [(f :.: g) p] -> (f :.: g) p #
(Monoid a, Monoid b, Monoid c, Monoid d, Monoid e) => Monoid (a, b, c, d, e) |
Instance details Defined in GHC.Base Methods mempty :: (a, b, c, d, e) # mappend :: (a, b, c, d, e) -> (a, b, c, d, e) -> (a, b, c, d, e) # mconcat :: [(a, b, c, d, e)] -> (a, b, c, d, e) #