Relation

object Relation

Collection of private classes, factories and extension methods for the Relation type

Source:
Relation.scala
class Object
trait Matchable
class Any

Value members

Concrete methods

def apply[A, B](f: A => Iterable[B]): A => B

Returns a relation given specified a function A => Seq[A].

Returns a relation given specified a function A => Seq[A].

Source:
Relation.scala
def apply[A, B](hash: Map[A, Iterable[B]]): A => B

Returns an influence relation specified by a map hash. For elements which are not in the keyset of hash, the relation returns the empty sequence.

Returns an influence relation specified by a map hash. For elements which are not in the keyset of hash, the relation returns the empty sequence.

Source:
Relation.scala
def apply[A, B](graph: IterableOnce[(A, B)]): A => B

Returns a relation specified by its graph, i.e., iterable of pairs a -> b, each meaning that a is in relation with b. When iterating over the image of a, elements are guaranteed to be returned in the order in which they appear in graph.

Returns a relation specified by its graph, i.e., iterable of pairs a -> b, each meaning that a is in relation with b. When iterating over the image of a, elements are guaranteed to be returned in the order in which they appear in graph.

Source:
Relation.scala
def apply[A, B](graph: (A, B)*): A => B

Returns a relation by its graph, i.e., the specified pairs a -> b, each meaning that a is in relation with b. When iterating over the image of u, elements are guaranteed to be returned in the order in which they appear in graph.

Returns a relation by its graph, i.e., the specified pairs a -> b, each meaning that a is in relation with b. When iterating over the image of u, elements are guaranteed to be returned in the order in which they appear in graph.

Source:
Relation.scala
@targetName("applyIterable")
def apply[A, B](graph: (A, Iterable[B])*): A => B

Returns a relation specified by the given pairs a -> X, each meaning that a is in relation with all the elements in the sequence X.

Returns a relation specified by the given pairs a -> X, each meaning that a is in relation with all the elements in the sequence X.

Source:
Relation.scala

Extensions

Extensions

extension [A](rel: A => A)
def withDiagonal: A => A

Returns a new relation where each element a is in relation with itself (in addition to the other elements it is already in relation with).

Returns a new relation where each element a is in relation with itself (in addition to the other elements it is already in relation with).

Source:
Relation.scala
extension [A, B](rel: A => B)
inline def apply(a: A): Iterable[B]

Returns the sequence of elements in relation with a.

Returns the sequence of elements in relation with a.

Source:
Relation.scala