Group

trait Group[a: Type] with Monoid[a]Source

A trait for types that form a group.

The default instances for numbers define the additive inverse in the real numbers.

Instances

instance Group[Unit]Source
instance Group[Int8]Source
instance Group[Int16]Source
instance Group[Int32]Source
instance Group[Int64]Source
instance Group[BigInt]Source
instance Group[Float32]Source
instance Group[Float64]Source
instance Group[BigDecimal]Source
instance Group[(a1, a2)] with Group[a1], Group[a2]Source
instance Group[(a1, a2, a3)] with Group[a1], Group[a2], Group[a3]Source
instance Group[(a1, a2, a3, a4)] with Group[a1], Group[a2], Group[a3], Group[a4]Source
instance Group[(a1, a2, a3, a4, a5)] with Group[a1], Group[a2], Group[a3], Group[a4], Group[a5]Source
instance Group[(a1, a2, a3, a4, a5, a6)] with Group[a1], Group[a2], Group[a3], Group[a4], Group[a5], Group[a6]Source
instance Group[(a1, a2, a3, a4, a5, a6, a7)] with Group[a1], Group[a2], Group[a3], Group[a4], Group[a5], Group[a6], Group[a7]Source
instance Group[(a1, a2, a3, a4, a5, a6, a7, a8)] with Group[a1], Group[a2], Group[a3], Group[a4], Group[a5], Group[a6], Group[a7], Group[a8]Source
instance Group[(a1, a2, a3, a4, a5, a6, a7, a8, a9)] with Group[a1], Group[a2], Group[a3], Group[a4], Group[a5], Group[a6], Group[a7], Group[a8], Group[a9]Source
instance Group[(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10)] with Group[a1], Group[a2], Group[a3], Group[a4], Group[a5], Group[a6], Group[a7], Group[a8], Group[a9], Group[a10]Source

Signatures

def inverse(x: a): a with Group[a] Source

Returns the inverse element of x.

Trait Definitions

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

Returns the result of combining x and y using Monoid's combine.

def empty(): a with Group[a] Source

Returns the neutral element.

def remove(x: a, y: a): a with Group[a] Source

Returns y removed from x.

Equivalent to Group.combine(x, Group.inverse(y))