Zero
com.phasmidsoftware.visitor.core.Zero
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 Objecttrait Matchableclass Any
- Known subtypes
Members list
In this article