Module

Data.Monoid.Coproduct

Package
purescript-monoid-extras
Repository
mikesol/purescript-monoid-extras

#type (:+:) Source

Operator alias for Data.Monoid.Coproduct.MonoidalCoproduct (non-associative / precedence 5)

#inL Source

inL :: forall m n. m -> m :+: n

Construct a coproduct with a left value.

#inR Source

inR :: forall m n. n -> m :+: n

Construct a coproduct with a right value.

#prependL Source

prependL :: forall m n. Semigroup m => m -> m :+: n -> m :+: n

Prepend a value from the left.

#prependR Source

prependR :: forall m n. Semigroup n => n -> m :+: n -> m :+: n

Prepend a value from the right.

#killL Source

killL :: forall m n. Action m n => Monoid n => m :+: n -> n

Extract @n@ from a coproduct.

#killR Source

killR :: forall m n. Monoid m => m :+: n -> m

Extract @m@ from a coproduct.

#untangle Source

untangle :: forall m n. Action m n => Monoid m => Monoid n => m :+: n -> (m /\ n)

#MonoidalCoproduct Source

data MonoidalCoproduct m n

@m :+: n@ is the coproduct of monoids @m@ and @n@. Concatentation

Constructors

Instances

#untangled Source

untangled :: forall m n m' n'. Action m n => Monoid m => Monoid n => Lens (m :+: n) (m' :+: n') (m /\ n) (m' /\ n')

Lens onto the both @m@ and @n@.

#_L Source

_L :: forall m n m'. Action m n => Monoid m => Monoid n => Semigroup n => Lens (m :+: n) (m' :+: n) m m'

Lens onto the left value of a coproduct.

#_R Source

_R :: forall m n n'. Action m n => Monoid m => Monoid n => Lens (m :+: n) (m :+: n') n n'

Lens onto the right value of a coproduct.