Semigroupal

public protocol Semigroupal

The Semigroupal type class for a given type F can be seen as an abstraction over the cartesian product. It defines the function product.

The product function for a given type F, A and B combines a Kind<F, A> and a Kind<F, B> into a Kind<F, (A, B)>. This function guarantees compliance with the following laws:

Semigroupals are associative under the bijection f = (a,(b,c)) -> ((a,b),c) or f = ((a,b),c) -> (a,(b,c)). Therefore, the following laws also apply:

f((a.product(b)).product(c)) == a.product(b.product(c))
f(a.product(b.product(c))) == (a.product(b)).product(c)