Copyright | (c) 2015 diagrams-core team (see LICENSE) |
---|---|
License | BSD-style (see LICENSE) |
Maintainer | diagrams-discuss@googlegroups.com |
Safe Haskell | Safe |
Language | Haskell2010 |
A strict coproduct of two monoids.
Synopsis
- data m :+: n
- inL :: m -> m :+: n
- inR :: n -> m :+: n
- prependL :: Semigroup m => m -> (m :+: n) -> m :+: n
- prependR :: Semigroup n => n -> (m :+: n) -> m :+: n
- killL :: (Action m n, Monoid' n) => (m :+: n) -> n
- killR :: Monoid m => (m :+: n) -> m
- untangle :: (Action m n, Monoid m, Monoid' n) => (m :+: n) -> (m, n)
- untangled :: (Action m n, Monoid m, Monoid' n) => Lens (m :+: n) (m' :+: n') (m, n) (m', n')
- _L :: (Action m n, Monoid m, Semigroup n) => Lens (m :+: n) (m' :+: n) m m'
- _R :: (Action m n, Monoid' n) => Lens (m :+: n) (m :+: n') n n'
Coproduct
m :+: n
is the coproduct of monoids m
and n
. Concatentation
is equivilent to
(m1 :+: n1) <> (m2 :+: n2) = (m1 <> m2) :+: (n1 <> act m1 n2)@
but has a more efficient internal implimentation.
Instances
(Action m n, Monoid m, Monoid' n, Show m, Show n) => Show (m :+: n) Source # | |
(Action m n, Semigroup m, Semigroup n) => Semigroup (m :+: n) Source # | |
(Action m n, Semigroup m, Semigroup n) => Monoid (m :+: n) Source # | |
(Action m n, Action m r, Action n r, Semigroup n) => Action (m :+: n) r Source # | Coproducts act on other things by having each of the components act individually. |
Defined in Data.Monoid.Coproduct.Strict |
Lenses
untangled :: (Action m n, Monoid m, Monoid' n) => Lens (m :+: n) (m' :+: n') (m, n) (m', n') Source #
Lens onto the both m
and n
.