HORIZON HASKELLDocslts/ghc-9.10.x248f8f02026-10-05Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · 248f8f0 · 2026-10-05

Modulemonoid-extras-0.6.2Haskell2010

Data.Monoid.Coproduct.Strict

A strict coproduct of two monoids.

  • 1 type
  • 10 values

Coproduct

8 declarations
datadata (:+:) m n
#

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.

Instances4Show, Semigroup, Monoid, Action
valueinL :: m -> m :+: n
#

Construct a coproduct with a left value.

valueinR :: n -> m :+: n
#

Construct a coproduct with a right value.

Lenses

value_R :: (Action m n, Monoid' n) => Lens (m :+: n) (m :+: n') n n'
#

Lens onto the right value of a coproduct.