flix

0.79.0

Group

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

Trait for types that form a group.

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

Instances

Primitives
Unit, Float32, Float64, BigDecimal, Int8, Int16, Int32, Int64, BigInt and tuples of 2 to 10 elements

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))