Package io.atlassian.fugue
Class Monoids
java.lang.Object
io.atlassian.fugue.Monoids
Monoid instances.- Since:
- 3.0
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Monoid<BigInteger> A monoid that adds big integers.static final Monoid<BigInteger> A monoid that multiplies big integers.A monoid that ANDs booleans.A monoid that ORs booleans.A monoid that XORs booleans.A monoid that adds integers.A monoid that multiplies integers.A monoid that adds longs.A monoid that multiplies longs.A monoid that appends strings.A monoid for the Unit value. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionA monoid Sums up values inside eitherSemigroups.either(io.atlassian.fugue.Semigroup<L>, io.atlassian.fugue.Semigroup<R>).A monoid for options (that take the first available value).A monoid for functions.iterable()A monoid for iterables.A monoid for options that take the last available value.list()A monoid for lists.A monoid for options that combine inner value with a semigroup.
-
Field Details
-
intAddition
A monoid that adds integers. -
intMultiplication
A monoid that multiplies integers. -
bigintAddition
A monoid that adds big integers. -
bigintMultiplication
A monoid that multiplies big integers. -
longAddition
A monoid that adds longs. -
longMultiplication
A monoid that multiplies longs. -
disjunction
A monoid that ORs booleans. -
exclusiveDisjunction
A monoid that XORs booleans. -
conjunction
A monoid that ANDs booleans. -
string
A monoid that appends strings. -
unit
A monoid for the Unit value.
-
-
Constructor Details
-
Monoids
private Monoids()
-
-
Method Details
-
function
A monoid for functions.- Type Parameters:
A- input typeB- composable output type- Parameters:
mb- The monoid for the function codomain.- Returns:
- A monoid for functions.
-
list
A monoid for lists.- Type Parameters:
A- internal type- Returns:
- A monoid for lists.
-
iterable
A monoid for iterables.- Type Parameters:
A- internal type- Returns:
- A monoid for iterables.
-
firstOption
A monoid for options (that take the first available value).- Type Parameters:
A- internal type- Returns:
- A monoid for options (that take the first available value).
-
lastOption
A monoid for options that take the last available value.- Type Parameters:
A- internal type- Returns:
- A monoid for options that take the last available value.
-
option
A monoid for options that combine inner value with a semigroup.- Type Parameters:
A- internal type- Parameters:
semigroup- aSemigroupobject.- Returns:
- A monoid for options that combine inner value with a semigroup.
-
either
A monoid Sums up values inside eitherSemigroups.either(io.atlassian.fugue.Semigroup<L>, io.atlassian.fugue.Semigroup<R>). Monoid of right values provide the identity element of the resulting monoid.- Type Parameters:
L- desired left typeR- desired right type- Parameters:
lS- semigroup for left valuesrM- monoid for right values.- Returns:
- A monoid Sums up values inside either.
-