free-algebras-0.0.3.0: Free algebras in Haskell.

Safe HaskellNone
LanguageHaskell2010

Data.Monoid.MSet

Description

Monoid and group actions (M-Sets and G-Sets). The category of MSets (and GSets) is monadic (unlike the category of SSets).

Synopsis

Documentation

class (Monoid m, SSet m a) => MSet m a Source #

Lawful instance should satisfy:

act mempty = id
g `act` h `act` a = g <> h `act` a

This is the same as to say that act is a monoid homomorphism from m to the monoid of endomorphisms of a (i.e. maps from a to a).

Note that if g is a Group then an MSet is simply a GSet, this is because monoids and groups share the same morphisms (a monoid homomorphis between groups necessarily preserves inverses).

Instances
Monoid m => MSet m m Source # 
Instance details

Defined in Data.Monoid.MSet

MSet m a => MSet m (IO a) Source # 
Instance details

Defined in Data.Monoid.MSet

MSet m a => MSet m (Down a) Source # 
Instance details

Defined in Data.Monoid.MSet

MSet m a => MSet m (Maybe a) Source # 
Instance details

Defined in Data.Monoid.MSet

MSet m a => MSet m (Identity a) Source # 
Instance details

Defined in Data.Monoid.MSet

(MSet m a, Ord a) => MSet m (Set a) Source # 
Instance details

Defined in Data.Monoid.MSet

MSet m a => MSet m (NonEmpty a) Source # 
Instance details

Defined in Data.Monoid.MSet

MSet m a => MSet m [a] Source # 
Instance details

Defined in Data.Monoid.MSet

Monoid m => MSet m (FreeMSet m a) Source # 
Instance details

Defined in Data.Monoid.MSet

MSet m b => MSet m (a -> b) Source # 
Instance details

Defined in Data.Monoid.MSet

MSet m b => MSet m (Either a b) Source # 
Instance details

Defined in Data.Monoid.MSet

(MSet m a, MSet m b) => MSet m (a, b) Source # 
Instance details

Defined in Data.Monoid.MSet

MSet m a => MSet m (Const a b) Source # 
Instance details

Defined in Data.Monoid.MSet

(MSet m a, MSet m b, MSet m c) => MSet m (a, b, c) Source # 
Instance details

Defined in Data.Monoid.MSet

(Functor f, Functor h, MSet m a) => MSet m (Sum f h a) Source # 
Instance details

Defined in Data.Monoid.MSet

(Functor f, Functor h, MSet m a) => MSet m (Product f h a) Source # 
Instance details

Defined in Data.Monoid.MSet

(MSet m a, MSet m b, MSet m c, MSet m d) => MSet m (a, b, c, d) Source # 
Instance details

Defined in Data.Monoid.MSet

(MSet m a, MSet m b, MSet m c, MSet m d, MSet m e) => MSet m (a, b, c, d, e) Source # 
Instance details

Defined in Data.Monoid.MSet

(MSet m a, MSet m b, MSet m c, MSet m d, MSet m e, MSet m f) => MSet m (a, b, c, d, e, f) Source # 
Instance details

Defined in Data.Monoid.MSet

(MSet m a, MSet m b, MSet m c, MSet m d, MSet m e, MSet m f, MSet m h) => MSet m (a, b, c, d, e, f, h) Source # 
Instance details

Defined in Data.Monoid.MSet

(MSet m a, MSet m b, MSet m c, MSet m d, MSet m e, MSet m f, MSet m h, MSet m i) => MSet m (a, b, c, d, e, f, h, i) Source # 
Instance details

Defined in Data.Monoid.MSet

MSet m a => MSet (Identity m) a Source # 
Instance details

Defined in Data.Monoid.MSet

MSet (Endo a) a Source # 
Instance details

Defined in Data.Monoid.MSet

Monoid m => MSet (Sum Natural) m Source # 
Instance details

Defined in Data.Monoid.MSet

newtype Endo a #

The monoid of endomorphisms under composition.

>>> let computation = Endo ("Hello, " ++) <> Endo (++ "!")
>>> appEndo computation "Haskell"
"Hello, Haskell!"

Constructors

Endo 

Fields

Instances
Generic (Endo a) 
Instance details

Defined in Data.Semigroup.Internal

Associated Types

type Rep (Endo a) :: * -> * #

Methods

from :: Endo a -> Rep (Endo a) x #

to :: Rep (Endo a) x -> Endo a #

Semigroup (Endo a)

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup.Internal

Methods

(<>) :: Endo a -> Endo a -> Endo a #

sconcat :: NonEmpty (Endo a) -> Endo a #

stimes :: Integral b => b -> Endo a -> Endo 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 #

SSet (Endo a) a Source # 
Instance details

Defined in Data.Semigroup.SSet

Methods

act :: Endo a -> a -> a Source #

MSet (Endo a) a Source # 
Instance details

Defined in Data.Monoid.MSet

type Rep (Endo a) 
Instance details

Defined in Data.Semigroup.Internal

type Rep (Endo a) = D1 (MetaData "Endo" "Data.Semigroup.Internal" "base" True) (C1 (MetaCons "Endo" PrefixI True) (S1 (MetaSel (Just "appEndo") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (a -> a))))

rep :: SSet s a => s -> Endo a Source #

fact :: (Functor f, SSet s a) => s -> f a -> f a Source #

Any SSet wrapped in a functor is a valid SSet.

newtype FreeMSet m a Source #

Constructors

FreeMSet 

Fields

Instances
Semigroup m => SSet m (FreeMSet m a) Source # 
Instance details

Defined in Data.Monoid.MSet

Methods

act :: m -> FreeMSet m a -> FreeMSet m a Source #

Monoid m => MSet m (FreeMSet m a) Source # 
Instance details

Defined in Data.Monoid.MSet

Monoid m => Monad (FreeMSet m) Source # 
Instance details

Defined in Data.Monoid.MSet

Methods

(>>=) :: FreeMSet m a -> (a -> FreeMSet m b) -> FreeMSet m b #

(>>) :: FreeMSet m a -> FreeMSet m b -> FreeMSet m b #

return :: a -> FreeMSet m a #

fail :: String -> FreeMSet m a #

Functor (FreeMSet m) Source # 
Instance details

Defined in Data.Monoid.MSet

Methods

fmap :: (a -> b) -> FreeMSet m a -> FreeMSet m b #

(<$) :: a -> FreeMSet m b -> FreeMSet m a #

Monoid m => Applicative (FreeMSet m) Source # 
Instance details

Defined in Data.Monoid.MSet

Methods

pure :: a -> FreeMSet m a #

(<*>) :: FreeMSet m (a -> b) -> FreeMSet m a -> FreeMSet m b #

liftA2 :: (a -> b -> c) -> FreeMSet m a -> FreeMSet m b -> FreeMSet m c #

(*>) :: FreeMSet m a -> FreeMSet m b -> FreeMSet m b #

(<*) :: FreeMSet m a -> FreeMSet m b -> FreeMSet m a #

Monoid m => FreeAlgebra (FreeMSet m) Source # 
Instance details

Defined in Data.Monoid.MSet

(Eq m, Eq a) => Eq (FreeMSet m a) Source # 
Instance details

Defined in Data.Monoid.MSet

Methods

(==) :: FreeMSet m a -> FreeMSet m a -> Bool #

(/=) :: FreeMSet m a -> FreeMSet m a -> Bool #

(Ord m, Ord a) => Ord (FreeMSet m a) Source # 
Instance details

Defined in Data.Monoid.MSet

Methods

compare :: FreeMSet m a -> FreeMSet m a -> Ordering #

(<) :: FreeMSet m a -> FreeMSet m a -> Bool #

(<=) :: FreeMSet m a -> FreeMSet m a -> Bool #

(>) :: FreeMSet m a -> FreeMSet m a -> Bool #

(>=) :: FreeMSet m a -> FreeMSet m a -> Bool #

max :: FreeMSet m a -> FreeMSet m a -> FreeMSet m a #

min :: FreeMSet m a -> FreeMSet m a -> FreeMSet m a #

(Show m, Show a) => Show (FreeMSet m a) Source # 
Instance details

Defined in Data.Monoid.MSet

Methods

showsPrec :: Int -> FreeMSet m a -> ShowS #

show :: FreeMSet m a -> String #

showList :: [FreeMSet m a] -> ShowS #

type AlgebraType0 (FreeMSet m :: * -> *) (a :: l) Source # 
Instance details

Defined in Data.Monoid.MSet

type AlgebraType0 (FreeMSet m :: * -> *) (a :: l) = ()
type AlgebraType (FreeMSet m :: * -> *) (a :: *) Source # 
Instance details

Defined in Data.Monoid.MSet

type AlgebraType (FreeMSet m :: * -> *) (a :: *) = MSet m a

hoistFreeMSet Source #

Arguments

:: (m -> n)

monoid homomorphism

-> FreeMSet m a 
-> FreeMSet n a