Bin

libretto.lambda.Bin
See theBin companion object
sealed trait Bin[<*>[_, _], T[_], F[_], A]

Binary tree with leafs holding values of types F[X], F[Y], ... The complete structure of the tree is expressed by the type A, using the tags for branches and leafs.

Type parameters

<*>

tag for branches, as it appears in A

A

captures the complete structure of the tree

F

value type of leafs. Each leaf holds a value of type F[X], for some type X (but appears in A as T[X]).

T

tag for leafs, as it appears in A

Attributes

Companion
object
Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class Branch[<*>, T, F, A, B]
class Leaf[<*>, T, F, A]

Members list

Type members

Classlikes

enum Partitioned[G[_], H[_], ~⚬[_, _]]

Attributes

Supertypes
trait Enum
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
Known subtypes
class Both[G, H, X, Y, ~⚬]

Value members

Concrete methods

def <*>[B](that: Bin[<*>, T, F, B]): Bin[<*>, T, F, A <*> B]
def deduplicateLeafs[->[_, _]](dup: [x] => F[x] => ->[T[x], T[x] <*> T[x]])(using leafTest: ClampEq[F], shuffled: ShuffledModule[->, <*>]): Exists[[X] =>> (Bin[<*>, T, F, X], shuffled.Shuffled[X, A])]
def foldMap[G[_]](map: [x] => F[x] => G[T[x]])(using G: Zippable[<*>, G]): G[A]
def foldMap0[B](map: [x] => F[x] => B, reduce: (B, B) => B): B
def foldMapWith[G[_]](map: [x] => F[x] => G[T[x]], zip: [x, y] => (G[x], G[y]) => G[x <*> y]): G[A]
def foldRight[B](b: B)(f: [x] => (F[x], B) => B): B
def getValue[V](using leafIsNotBranch: [x, y, z] => (T[x] =:= (y <*> z)) => Nothing, T: Injective[T], ev: A =:= T[V]): F[V]
def mapLeafs[G[_]](f: [x] => F[x] => G[x]): Bin[<*>, T, G, A]
def mask: Masked[[_] =>> Bin[<*>, T, F, _$5], A]
def partition[G[_], H[_]](f: [x] => F[x] => Either[G[x], H[x]])(using shuffle: Shuffle[<*>]): Partitioned[G, H, shuffle.~⚬]
def relabelLeafs[U[_], Tr[_, _]](leafTr: [X] => Unit => Tr[T[X], U[X]], parTr: [A1, A2, B1, B2] => (Tr[A1, B1], Tr[A2, B2]) => Tr[A1 <*> A2, B1 <*> B2]): Exists[[B] =>> (Tr[A, B], Bin[<*>, U, F, B])]
def relabelLeafs[U[_], Tr[_, _], B](tr: Tr[A, B], leafToLeaf: [X, UX] => Tr[T[X], UX] => UX =:= U[X])(using rel: PairwiseRel[<*>, <*>, Tr]): Bin[<*>, U, F, B]
infix def union[B, ->[_, _]](that: Bin[<*>, T, F, B])(discardFst: [X, Y] => F[X] => ->[T[X] <*> Y, Y])(using leafTest: ClampEq[F], shuffled: ShuffledModule[->, <*>]): Exists[[P] =>> (Bin[<*>, T, F, P], shuffled.Shuffled[P, A], shuffled.Shuffled[P, B])]

Returns a tree with the least common superset of leaves and projections to get back to each of the two inputs.

Returns a tree with the least common superset of leaves and projections to get back to each of the two inputs.

Attributes