flix

0.79.0

SemiGroup

Trait for types that form a semigroup, and its functions.

trait SemiGroup[a: Type]Source

Trait for types that form a semigroup.

Instances

Primitives
Unit, Float32, Float64, BigDecimal, Int8, Int16, Int32, Int64, BigInt, String, Vector[a] and tuples of 2 to 10 elements
Non-primitives
All, Any, Chain[a], DelayList[a], Identity[a], List[a], Map[k, v], MultiMap[k, v], Nec[a], Nel[a], Option[a], RichString, Set[a], Validation[e, t]

Signatures

def combine(x: a, y: a): a with SemiGroup[a]§ Source

An associative binary operation on a.

Trait Definitions

def combineN(x: a, n: Int32): a with SemiGroup[a]§ Source

Returns x combined with itself n times.