LanguageExt.Core

LanguageExt.Core Traits Semigroup

Contents

interface Semigroup <A> Source #

where A : Semigroup<A>

Properties

property SemigroupInstance<A> Instance Source #

Property that contains the trait in record form. This allows the trait to be passed around as a value rather than resolved as a type. It helps us get around limitations in the C# constraint system.

Methods

method A Combine (A rhs) Source #

An associative binary operation.

Parameters

param this

The first operand to the operation

param rhs

The second operand to the operation

returns

The result of the operation

Operators

operator + (A lhs, A rhs) Source #

An associative binary operation.

Parameters

param lhs

The first operand to the operation

param rhs

The second operand to the operation

returns

The result of the operation

record SemigroupInstance <A> (Func<A, A, A> Combine) Source #

Contains the trait in record form. This allows the trait to be passed around as a value rather than resolved as a type. It helps us get around limitations in the C# constraint system.

Parameters

type A

Trait type

param Combine

An associative binary operation.

Properties

property Option<SemigroupInstance<A>> Instance Source #

The A type should derive from Semigroup〈A〉. If so, we can get a SemigroupInstance〈A〉 that we can pass around as a value. If not, then we will get None, which means the type is not a semigroup.

class Semigroup Source #

Methods

method A combine <A> (A x, A y) Source #

where A : Semigroup<A>

An associative binary operation

Parameters

param x

The left hand side of the operation

param y

The right hand side of the operation

returns

The result of the operation

method SemigroupInstance<A> instance <A> () Source #

where A : Semigroup<A>

Get a concrete semigroup instance value from a semigroup supporting trait-type

Parameters

type A

Semigroup type

returns

Semigroup instance that can be passed around as a value

class SemigroupExtensions Source #

Operators

operator + (A lhs, A rhs) Source #

Semigroup combine operator: an associative binary operation.

Parameters

param lhs

Left-hand side operand

param rhs

Right-hand side operand

returns

class Prelude Source #

Methods

method A combine <A> (A x, A y) Source #

where A : Semigroup<A>

An associative binary operation

Parameters

param x

The left hand side of the operation

param y

The right hand side of the operation

returns

The result of the operation

method Either<L, R> combine <L, R> (Either<L, R> lhs, Either<L, R> rhs) Source #

where R : Semigroup<R>

An associative binary operation

Parameters

param lhs

Left-hand side of the operation

param rhs

Right-hand side of the operation

returns

lhs + rhs

method Option<A> combine <A> (Option<A> x, Option<A> y) Source #

where A : Semigroup<A>

An associative binary operation

Parameters

param x

The left hand side of the operation

param y

The right hand side of the operation

returns

The result of the operation

method IEnumerable<A> combine <A> (IEnumerable<A> x, IEnumerable<A> y) Source #

where A : Semigroup<A>

An associative binary operation

Parameters

param x

The left hand side of the operation

param y

The right hand side of the operation

returns

The result of the operation