Interface Semigroup<A>
- Type Parameters:
A
- The element type this Semigroup is formed over
- All Superinterfaces:
Applicative<Fn1<A,
,A>, Fn1<A, ?>> Cartesian<A,
,Fn1<A, A>, Fn1<?, ?>> Cocartesian<A,
,Fn1<A, A>, Fn1<?, ?>> Contravariant<A,
,Profunctor<?, Fn1<A, A>, Fn1<?, ?>>> Fn1<A,
,Fn1<A, A>> Fn2<A,
,A, A> Functor<Fn1<A,
,A>, Fn1<A, ?>> Monad<Fn1<A,
,A>, Fn1<A, ?>> MonadReader<A,
,Fn1<A, A>, Fn1<A, ?>> MonadRec<Fn1<A,
,A>, Fn1<A, ?>> MonadWriter<A,
,Fn1<A, A>, Fn1<A, ?>> Profunctor<A,
Fn1<A, A>, Fn1<?, ?>>
- All Known Subinterfaces:
Monoid<A>
- All Known Implementing Classes:
And
,Concat
,Endo
,First
,Intersection
,Join
,Last
,Max
,MergeHMaps
,Min
,Or
,PutAll
,Trivial
,Union
,Xor
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
A
Semigroup
is a closed, associative category. As closure can be implied by the type signature, and
associativity is not enforceable, this is simply represented as a binary operator.-
Method Summary
Modifier and TypeMethodDescriptionflip()
Flip the order of the arguments.default A
Catamorphism under this semigroup usingFoldLeft
, where the binary operator is this semigroup, and the starting accumulator is provided.Catamorphism under this semigroup usingFoldRight
, where the binary operator is this semigroup, and the starting accumulator is provided.Methods inherited from interface com.jnape.palatable.lambda.functions.Fn1
andThen, carry, cartesian, censor, choose, cocartesian, diMap, diMapR, discardL, flatMap, fmap, lazyZip, listens, local, pure, self, thunk, toFunction, trampolineM, zip, zip
Methods inherited from interface com.jnape.palatable.lambda.functions.Fn2
apply, apply, checkedApply, checkedApply, compose, contraMap, diMapL, discardR, toBiFunction, uncurry, widen
-
Method Details
-
foldLeft
Catamorphism under this semigroup usingFoldLeft
, where the binary operator is this semigroup, and the starting accumulator is provided.- Parameters:
a
- the starting accumulatoras
- the elements to fold over- Returns:
- the folded result
- See Also:
-
foldRight
Catamorphism under this semigroup usingFoldRight
, where the binary operator is this semigroup, and the starting accumulator is provided.- Parameters:
a
- the starting accumulatoras
- the elements to fold over- Returns:
- the folded result
- See Also:
-
flip
Flip the order of the arguments.
-