com.jnape.palatable.lambda.semigroup

## 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, 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.

      @FunctionalInterface
      public interface Semigroup<A>
      extends Fn2<A,A,A>

  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

    All Methods Instance Methods Default Methods
    Modifier and Type | Method and Description
    --- | ---
    `default Semigroup<A>` | `flip()` Flip the order of the arguments.
    `default A` | `foldLeft(A a, Iterable<A> as)` Catamorphism under this semigroup using `FoldLeft`, where the binary operator is this semigroup, and the starting accumulator is provided.
    `default Lazy<A>` | `foldRight(A a, Iterable<A> as)` Catamorphism under this semigroup using `FoldRight`, where the binary operator is this semigroup, and the starting accumulator is provided.

    - ### Methods inherited from interface com.jnape.palatable.lambda.functions.Fn2

      `apply, apply, checkedApply, checkedApply, compose, contraMap, curried, curry, diMapL, discardR, fn2, fromBiFunction, toBiFunction, uncurry, widen`

    - ### Methods inherited from interface com.jnape.palatable.lambda.functions.Fn1

      `andThen, carry, cartesian, censor, choose, cocartesian, diMap, diMapR, discardL, flatMap, fmap, fn1, fromFunction, lazyZip, listens, local, pure, pureFn1, thunk, toFunction, trampolineM, zip, zip`

    - ### Methods inherited from interface com.jnape.palatable.lambda.monad.Monad

      `join`

    - ### Methods inherited from interface com.jnape.palatable.lambda.functor.Functor

      `coerce`

- - ### Method Detail

    - #### foldLeft

          default A foldLeft(A a,
                             Iterable<A> as)

      Catamorphism under this semigroup using `FoldLeft`, where the binary operator is this semigroup, and the starting accumulator is provided.
      Parameters:
        `a` - the starting accumulator
        `as` - the elements to fold over
      Returns:
        the folded result
      See Also:
        `FoldLeft`

    - #### foldRight

          default Lazy<A> foldRight(A a,
                                    Iterable<A> as)

      Catamorphism under this semigroup using `FoldRight`, where the binary operator is this semigroup, and the starting accumulator is provided.
      Parameters:
        `a` - the starting accumulator
        `as` - the elements to fold over
      Returns:
        the folded result
      See Also:
        `FoldRight`

    - #### flip

          default Semigroup<A> flip()

      Flip the order of the arguments.
      Specified by:
        `flip` in interface `Fn2<A,A,A>`
      Returns:
        an `Fn2`<B, A, C>