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

Safe HaskellNone
LanguageHaskell2010

Control.Monad.Chronicle

Contents

Description

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

Synopsis

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 (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 #

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 #

(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.

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

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, 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, 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, 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, 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, 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, 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, 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, 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, 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 #

(.>) :: ChronicleT c m a -> ChronicleT c m b -> ChronicleT c m b #

(<.) :: ChronicleT c m a -> ChronicleT c m b -> ChronicleT c m a #

liftF2 :: (a -> b -> c0) -> ChronicleT c m a -> ChronicleT c m b -> ChronicleT c m c0 #

(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 #

join :: ChronicleT c m (ChronicleT c m a) -> ChronicleT c m a #

class Semigroup a => Monoid a where #

The class of monoids (types with an associative binary operation that has an identity). Instances should satisfy the following laws:

The method names refer to the monoid of lists under concatenation, but there are many other instances.

Some types can be viewed as a monoid in more than one way, e.g. both addition and multiplication on numbers. In such cases we often define newtypes and make those instances of Monoid, e.g. Sum and Product.

NOTE: Semigroup is a superclass of Monoid since base-4.11.0.0.

Minimal complete definition

mempty

Methods

mempty :: a #

Identity of mappend

mappend :: a -> a -> a #

An associative operation

NOTE: This method is redundant and has the default implementation mappend = '(<>)' since base-4.11.0.0.

mconcat :: [a] -> a #

Fold a list using the monoid.

For most types, the default definition for mconcat will be used, but the function is included in the class definition so that an optimized version can be provided for specific types.

Instances
Monoid Ordering

Since: base-2.1

Instance details

Defined in GHC.Base

Monoid ()

Since: base-2.1

Instance details

Defined in GHC.Base

Methods

mempty :: () #

mappend :: () -> () -> () #

mconcat :: [()] -> () #

Monoid ByteString 
Instance details

Defined in Data.ByteString.Internal

Monoid ByteString 
Instance details

Defined in Data.ByteString.Lazy.Internal

Monoid Builder 
Instance details

Defined in Data.ByteString.Builder.Internal

Monoid Series 
Instance details

Defined in Data.Aeson.Encoding.Internal

Monoid More 
Instance details

Defined in Data.Attoparsec.Internal.Types

Methods

mempty :: More #

mappend :: More -> More -> More #

mconcat :: [More] -> More #

Monoid All

Since: base-2.1

Instance details

Defined in Data.Semigroup.Internal

Methods

mempty :: All #

mappend :: All -> All -> All #

mconcat :: [All] -> All #

Monoid Any

Since: base-2.1

Instance details

Defined in Data.Semigroup.Internal

Methods

mempty :: Any #

mappend :: Any -> Any -> Any #

mconcat :: [Any] -> Any #

Monoid ShortByteString 
Instance details

Defined in Data.ByteString.Short.Internal

Monoid IntSet 
Instance details

Defined in Data.IntSet.Internal

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

Monoid [a]

Since: base-2.1

Instance details

Defined in GHC.Base

Methods

mempty :: [a] #

mappend :: [a] -> [a] -> [a] #

mconcat :: [[a]] -> [a] #

Semigroup a => Monoid (Maybe a)

Lift a semigroup into Maybe forming a Monoid according to http://en.wikipedia.org/wiki/Monoid: "Any semigroup S may be turned into a monoid simply by adjoining an element e not in S and defining e*e = e and e*s = s = s*e for all s ∈ S."

Since 4.11.0: constraint on inner a value generalised from Monoid to Semigroup.

Since: base-2.1

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)

Since: base-4.9.0.0

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)

Since: base-4.12.0.0

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 #

(Ord a, Bounded a) => Monoid (Min a)

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Methods

mempty :: Min a #

mappend :: Min a -> Min a -> Min a #

mconcat :: [Min a] -> Min a #

(Ord a, Bounded a) => Monoid (Max a)

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Methods

mempty :: Max a #

mappend :: Max a -> Max a -> Max a #

mconcat :: [Max a] -> Max a #

Monoid m => Monoid (WrappedMonoid m)

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Semigroup a => Monoid (Option a)

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Methods

mempty :: Option a #

mappend :: Option a -> Option a -> Option a #

mconcat :: [Option a] -> Option a #

Monoid a => Monoid (Identity a)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Identity

Methods

mempty :: Identity a #

mappend :: Identity a -> Identity a -> Identity a #

mconcat :: [Identity a] -> Identity a #

Monoid (First a)

Since: base-2.1

Instance details

Defined in Data.Monoid

Methods

mempty :: First a #

mappend :: First a -> First a -> First a #

mconcat :: [First a] -> First a #

Monoid (Last a)

Since: base-2.1

Instance details

Defined in Data.Monoid

Methods

mempty :: Last a #

mappend :: Last a -> Last a -> Last a #

mconcat :: [Last a] -> Last a #

Monoid a => Monoid (Dual a)

Since: base-2.1

Instance details

Defined in Data.Semigroup.Internal

Methods

mempty :: Dual a #

mappend :: Dual a -> Dual a -> Dual a #

mconcat :: [Dual a] -> Dual a #

Monoid (Endo a)

Since: base-2.1

Instance details

Defined in Data.Semigroup.Internal

Methods

mempty :: Endo a #

mappend :: Endo a -> Endo a -> Endo a #

mconcat :: [Endo a] -> Endo a #

Num a => Monoid (Sum a)

Since: base-2.1

Instance details

Defined in Data.Semigroup.Internal

Methods

mempty :: Sum a #

mappend :: Sum a -> Sum a -> Sum a #

mconcat :: [Sum a] -> Sum a #

Num a => Monoid (Product a)

Since: base-2.1

Instance details

Defined in Data.Semigroup.Internal

Methods

mempty :: Product a #

mappend :: Product a -> Product a -> Product a #

mconcat :: [Product a] -> Product a #

Monoid a => Monoid (Down a)

Since: base-4.11.0.0

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 (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 (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 #

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 #

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 #

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 #

(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 (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 #

PrimUnlifted a => Monoid (UnliftedArray a)

Since: primitive-0.6.4.0

Instance details

Defined in Data.Primitive.UnliftedArray

Monoid (PrimArray a)

Since: primitive-0.6.4.0

Instance details

Defined in Data.Primitive.PrimArray

Monoid (SmallArray a) 
Instance details

Defined in Data.Primitive.SmallArray

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 (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)

Since: base-2.1

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)

Since: base-4.12.0.0

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)

Since: base-2.1

Instance details

Defined in GHC.Base

Methods

mempty :: (a, b) #

mappend :: (a, b) -> (a, b) -> (a, b) #

mconcat :: [(a, b)] -> (a, b) #

Monoid a => Monoid (ST s a)

Since: base-4.11.0.0

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 #

(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 (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 (Proxy s)

Since: base-4.7.0.0

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 (f p) => Monoid (Rec1 f p)

Since: base-4.12.0.0

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)

Since: base-2.1

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) #

Monoid a => Monoid (Const a b)

Since: base-4.9.0.0

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 #

(Applicative f, Monoid a) => Monoid (Ap f a)

Since: base-4.12.0.0

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 #

Alternative f => Monoid (Alt f a)

Since: base-4.8.0.0

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 #

Monoid (ReifiedIndexedFold i s a) 
Instance details

Defined in Control.Lens.Reified

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 #

Reifies s (ReifiedMonoid a) => Monoid (ReflectedMonoid a s) 
Instance details

Defined in Data.Reflection

(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 #

Monoid c => Monoid (K1 i c p)

Since: base-4.12.0.0

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)

Since: base-4.12.0.0

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)

Since: base-2.1

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)

Since: base-4.12.0.0

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)

Since: base-4.12.0.0

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)

Since: base-2.1

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) #