Safe Haskell  None 

Language  Haskell2010 
Monoid and group actions (MSets and GSets).
The category of MSet
s (and GSet
s) is monadic (unlike the category of SSet
s).
Synopsis
 class (Monoid m, SSet m a) => MSet m a
 class Semigroup s => SSet s a where
 newtype Endo a = Endo {
 appEndo :: a > a
 rep :: SSet s a => s > Endo a
 fact :: (Functor f, SSet s a) => s > f a > f a
 newtype FreeMSet m a = FreeMSet {
 runFreeMSet :: (m, a)
 hoistFreeMSet :: (m > n) > FreeMSet m a > FreeMSet n a
 foldrMSet :: forall m a b. MSet m b => (a > b > b) > b > (m, a) > b
 newtype S s = S {
 runS :: s
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
then an Group
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 #  
Defined in Data.Monoid.MSet  
MSet m a => MSet m (IO a) Source #  
Defined in Data.Monoid.MSet  
MSet m a => MSet m (Down a) Source #  
Defined in Data.Monoid.MSet  
MSet m a => MSet m (Maybe a) Source #  
Defined in Data.Monoid.MSet  
MSet m a => MSet m (Identity a) Source #  
Defined in Data.Monoid.MSet  
(MSet m a, Ord a) => MSet m (Set a) Source #  
Defined in Data.Monoid.MSet  
MSet m a => MSet m (NonEmpty a) Source #  
Defined in Data.Monoid.MSet  
MSet m a => MSet m [a] Source #  
Defined in Data.Monoid.MSet  
Monoid m => MSet m (FreeMSet m a) Source #  
Defined in Data.Monoid.MSet  
MSet m b => MSet m (a > b) Source #  
Defined in Data.Monoid.MSet  
MSet m b => MSet m (Either a b) Source #  
Defined in Data.Monoid.MSet  
(MSet m a, MSet m b) => MSet m (a, b) Source #  
Defined in Data.Monoid.MSet  
MSet m a => MSet m (Const a b) Source #  
Defined in Data.Monoid.MSet  
(MSet m a, MSet m b, MSet m c) => MSet m (a, b, c) Source #  
Defined in Data.Monoid.MSet  
(Functor f, Functor h, MSet m a) => MSet m (Sum f h a) Source #  
Defined in Data.Monoid.MSet  
(Functor f, Functor h, MSet m a) => MSet m (Product f h a) Source #  
Defined in Data.Monoid.MSet  
(MSet m a, MSet m b, MSet m c, MSet m d) => MSet m (a, b, c, d) Source #  
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 #  
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 #  
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 #  
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 #  
Defined in Data.Monoid.MSet  
MSet m a => MSet (Identity m) a Source #  
Defined in Data.Monoid.MSet  
MSet (Endo a) a Source #  
Defined in Data.Monoid.MSet  
Monoid m => MSet (Sum Natural) m Source #  
Defined in Data.Monoid.MSet  
MSet m a => MSet (S m) a Source #  
Defined in Data.Monoid.MSet  
MSet m b => MSet (S m) (Endo b) Source #  
Defined in Data.Monoid.MSet 
class Semigroup s => SSet s a where Source #
A lawful instance should satisfy:
g `act` h `act` a = g <> h `act` a
This is the same as to say that act
is a semigroup homomorphism from s
to
the monoid of endomorphisms of a
(i.e. maps from a
to a
).
Note that if g
is a
then Group
is simply a MAct
gGSet
, this
is because monoids and groups share the same morphisms (a monoid homomorphis
between groups necessarily preserves inverses).
Instances
Semigroup s => SSet s s Source #  
Defined in Data.Semigroup.SSet  
SSet s a => SSet s (IO a) Source #  
SSet s a => SSet s (Down a) Source #  
SSet s a => SSet s (Maybe a) Source #  
SSet s a => SSet s (Identity a) Source #  
(SSet s a, Ord a) => SSet s (Set a) Source #  
SSet s a => SSet s (NonEmpty a) Source #  
SSet s a => SSet s [a] Source #  
Defined in Data.Semigroup.SSet  
SSet s b => SSet s (a > b) Source #  
Defined in Data.Semigroup.SSet  
SSet s b => SSet s (Either a b) Source #  
(SSet s a, SSet s b) => SSet s (a, b) Source #  
Defined in Data.Semigroup.SSet  
Semigroup m => SSet m (FreeMSet m a) Source #  
SSet s a => SSet s (Const a b) Source #  
(SSet s a, SSet s b, SSet s c) => SSet s (a, b, c) Source #  
Defined in Data.Semigroup.SSet  
(Functor f, Functor h, SSet s a) => SSet s (Sum f h a) Source #  
(Functor f, Functor h, SSet s a) => SSet s (Product f h a) Source #  
(SSet s a, SSet s b, SSet s c, SSet s d) => SSet s (a, b, c, d) Source #  
Defined in Data.Semigroup.SSet  
(SSet s a, SSet s b, SSet s c, SSet s d, SSet s e) => SSet s (a, b, c, d, e) Source #  
Defined in Data.Semigroup.SSet  
(SSet s a, SSet s b, SSet s c, SSet s d, SSet s e, SSet s f) => SSet s (a, b, c, d, e, f) Source #  
Defined in Data.Semigroup.SSet  
(SSet s a, SSet s b, SSet s c, SSet s d, SSet s e, SSet s f, SSet s h) => SSet s (a, b, c, d, e, f, h) Source #  
Defined in Data.Semigroup.SSet  
(SSet s a, SSet s b, SSet s c, SSet s d, SSet s e, SSet s f, SSet s h, SSet s i) => SSet s (a, b, c, d, e, f, h, i) Source #  
Defined in Data.Semigroup.SSet  
SSet s a => SSet (Identity s) a Source #  
Defined in Data.Semigroup.SSet  
SSet (Endo a) a Source #  
Defined in Data.Semigroup.SSet  
Group g => SSet (Sum Integer) g Source #  
Monoid s => SSet (Sum Natural) s Source #  
SSet m a => SSet (S m) a Source #  
Defined in Data.Semigroup.SSet  
SSet s a => SSet (S s) (Endo a) Source #  
The monoid of endomorphisms under composition.
>>>
let computation = Endo ("Hello, " ++) <> Endo (++ "!")
>>>
appEndo computation "Haskell"
"Hello, Haskell!"
Instances
Generic (Endo a)  
Semigroup (Endo a)  Since: base4.9.0.0 
Monoid (Endo a)  Since: base2.1 
SSet (Endo a) a Source #  
Defined in Data.Semigroup.SSet  
MSet (Endo a) a Source #  
Defined in Data.Monoid.MSet  
SSet s a => SSet (S s) (Endo a) Source #  
MSet m b => MSet (S m) (Endo b) Source #  
Defined in Data.Monoid.MSet  
type Rep (Endo a)  
Defined in Data.Semigroup.Internal 
FreeMSet  

Instances
A newtype wrapper to avoid overlapping instances.
Instances
Semigroup m => Semigroup (S m) Source #  
Monoid m => Monoid (S m) Source #  
SSet m a => SSet (S m) a Source #  
Defined in Data.Semigroup.SSet  
MSet m a => MSet (S m) a Source #  
Defined in Data.Monoid.MSet  
SSet s a => SSet (S s) (Endo a) Source #  
MSet m b => MSet (S m) (Endo b) Source #  
Defined in Data.Monoid.MSet 