Zero

com.phasmidsoftware.visitor.core.Zero
trait Zero[A]

Typeclass: a type with an identity element.

Zero[A] is the minimal requirement for weighted graph traversals that need a seed cost but do not accumulate costs along a path — specifically Prim's MST algorithm. Prim needs identity to seed the frontier but never calls combine.

Monoid[A] extends Zero[A] by adding combine, making Zero the honest supertype for the two-context-bound pattern E: {Zero, Ordering}.

Any given Monoid[A] automatically satisfies Zero[A] through inheritance.

Type parameters

A

the element type

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes

Members list

Value members

Abstract methods

def identity: A

The identity element.

The identity element.

Attributes