CoreLib

libretto.CoreLib
See theCoreLib companion object
opaque class CoreLib[DSL <: CoreDSL](val dsl: DSL)

Attributes

Companion:
object
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
CoreLib[DSL]

Members list

Concise view

Type members

Classlikes

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type
trait BiExternalizer[F[_, _]]

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type
object Bifunctor

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type
class BimapSyntax[F[_, _], A, B](self: A -⚬ B)

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
object Bool

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type
Bool.type
trait Comparable[A, B]

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type
opaque object Compared

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Attributes

Companion:
trait
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
trait ContraExternalizer[F[_]]

Contravariant functor from category -⚬ to the category => of Scala functions. It takes a morphism A -⚬ B internal to the DSL and maps it to a morphism F[B] => F[A] in the meta language (Scala), i.e. external to the DSL.

Contravariant functor from category -⚬ to the category => of Scala functions. It takes a morphism A -⚬ B internal to the DSL and maps it to a morphism F[B] => F[A] in the meta language (Scala), i.e. external to the DSL.

Attributes

Companion:
object
Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type
object Deferrable

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type
object Deferred

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type
object Detained

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type
object Dual

Attributes

Companion:
trait
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
Dual.type
trait Dual[A, B]

Evidence that A flowing in one direction is equivalent to to B flowing in the opposite direction. It must hold that

Evidence that A flowing in one direction is equivalent to to B flowing in the opposite direction. It must hold that

       ┏━━━━━┓                         ┏━━━━━┓
       ┞─┐ r ┃                         ┃  l  ┞─┐
       ╎A│ I ┃                         ┃  I  ╎B│
       ┟─┘ n ┃                         ┃  n  ┟─┘
 ┏━━━━━┫   v ┃     ┏━━━━━━━━━┓         ┃  v  ┣━━━━━┓     ┏━━━━━━━━━┓
 ┃  l  ┞─┐ e ┃     ┞─┐       ┞─┐       ┃  e  ┞─┐ r ┃     ┞─┐       ┞─┐
 ┃  I  ╎B│ r ┃  =  ╎A│ id[A] ╎A│       ┃  r  ╎A│ I ┃  =  ╎B│ id[B] ╎B│
 ┃  n  ┟─┘ t ┃     ┟─┘       ┟─┘       ┃  t  ┟─┘ n ┃     ┟─┘       ┟─┘
 ┃  v  ┣━━━━━┛     ┗━━━━━━━━━┛         ┗━━━━━┫   v ┃     ┗━━━━━━━━━┛
 ┃  e  ┞─┐                                   ┞─┐ e ┃
 ┃  r  ╎A│                                   ╎B│ r ┃
 ┃  t  ┟─┘                                   ┟─┘ t ┃
 ┗━━━━━┛                                     ┗━━━━━┛

Attributes

Companion:
object
Graph
Supertypes
class Object
trait Matchable
class Any
trait Dual1[F[_], G[_]]

Evidence that if A is dual to B, then F[A] is dual to G[B].

Evidence that if A is dual to B, then F[A] is dual to G[B].

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
object Endless

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type
Endless.type

Attributes

Companion:
trait
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
trait Externalizer[F[_]]

Functor from category -⚬ to the category => of Scala functions. It takes a morphism A -⚬ B internal to the DSL and maps it to a morphism F[A] => F[B] in the meta language (Scala), i.e. external to the DSL.

Functor from category -⚬ to the category => of Scala functions. It takes a morphism A -⚬ B internal to the DSL and maps it to a morphism F[A] => F[B] in the meta language (Scala), i.e. external to the DSL.

Attributes

Companion:
object
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
class FocusedBi[F[_, _], B1, B2](f: F[B1, B2])(F: BiExternalizer[F])

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
class FocusedCo[F[_], B](f: F[B])(implicit F: Externalizer[F])

Focused on B in F[B], where B is in a covariant position.

Focused on B in F[B], where B is in a covariant position.

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
class FocusedContra[F[_], B](f: F[B])(implicit F: ContraExternalizer[F])

Focused on B in F[B], where B is in a contravariant position.

Focused on B in F[B], where B is in a contravariant position.

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
implicit class FocusedOnChoiceCo[F[_], B1, B2](f: FocusedCo[F, B1 |&| B2])

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
implicit class FocusedOnChoiceContra[A, F[_], B1, B2](f: FocusedContra[F, B1 |&| B2])

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
implicit class FocusedOnDoneTimesCo[F[_], B2](f: FocusedCo[F, Done |*| B2])(implicit j: Positive[B2])

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
implicit class FocusedOnPairCo[F[_], B1, B2](f: FocusedCo[F, B1 |*| B2])

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
implicit class FocusedOnPairContra[A, F[_], B1, B2](f: FocusedContra[F, B1 |*| B2])

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
implicit class FocusedOnPlusCo[F[_], B1, B2](f: FocusedCo[F, B1 |+| B2])

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
implicit class FocusedOnPlusContra[A, F[_], B1, B2](f: FocusedContra[F, B1 |+| B2])

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
implicit class FocusedOnTimesDoneCo[F[_], B1](f: FocusedCo[F, B1 |*| Done])(implicit j: Positive[B1])

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
object Functor

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type
Functor.type
object Getter

Attributes

Companion:
trait
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
Getter.type
trait Getter[S, A]

Attributes

Companion:
object
Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
trait Lens[S, A]
Self type
Getter[S, A]
object Junction

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type
object LList

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type
LList.type
object LList1

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type
LList1.type
object Lens

Attributes

Companion:
trait
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
Lens.type
trait Lens[S, A] extends Getter[S, A]

Attributes

Companion:
object
Graph
Supertypes
trait Getter[S, A]
class Object
trait Matchable
class Any
implicit class LinearFunctionOps[A, B](self: A -⚬ B)

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
implicit class LinearFunctionToPairOps[A, B1, B2](self: A -⚬ B1 |*| B2)

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
implicit class LinearFunctionToPlusOps[A, B1, B2](self: A -⚬ B1 |+| B2)

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
object Lock

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type
Lock.type
object Maybe

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type
Maybe.type
object Monoid

Attributes

Companion:
trait
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
Monoid.type
trait Monoid[A] extends Semigroup[A]

Attributes

Companion:
object
Graph
Supertypes
trait Semigroup[A]
class Object
trait Matchable
class Any
object Multiple

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type
object NAffine

Attributes

Companion:
trait
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
NAffine.type
trait NAffine[A]

Attributes

Companion:
object
Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
trait NComonoid[A]
trait NComonoid[A] extends Cosemigroup[A] with NAffine[A]

A Comonoid whose counit can be chained before a signal flowing in the '''N'''egative direction (Need), effectively taking on the responsibility to await completion of some computation.

A Comonoid whose counit can be chained before a signal flowing in the '''N'''egative direction (Need), effectively taking on the responsibility to await completion of some computation.

The dual of PMonoid.

Attributes

Graph
Supertypes
trait NAffine[A]
trait Cosemigroup[A]
class Object
trait Matchable
class Any
object NMonoid

Attributes

Companion:
trait
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
NMonoid.type
trait NMonoid[A] extends Semigroup[A]

A weaker version of Monoid whose unit creates a liability - a signal traveling in the '''N'''egative direction (Need) that eventually needs to be awaited.

A weaker version of Monoid whose unit creates a liability - a signal traveling in the '''N'''egative direction (Need) that eventually needs to be awaited.

Its dual is PComonoid.

Attributes

Companion:
object
Graph
Supertypes
trait Semigroup[A]
class Object
trait Matchable
class Any
object Optionally

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type
object PAffine

Attributes

Companion:
trait
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
PAffine.type
trait PAffine[A]

Attributes

Companion:
object
Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
trait PComonoid[A]
object PComonoid

Attributes

Companion:
trait
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
trait PComonoid[A] extends Cosemigroup[A] with PAffine[A]

A weaker version of Comonoid whose counit cannot discard the input completely, but can reduce it to a signal traveling in the '''P'''ositive direction (Done) that eventually needs to be awaited.

A weaker version of Comonoid whose counit cannot discard the input completely, but can reduce it to a signal traveling in the '''P'''ositive direction (Done) that eventually needs to be awaited.

The dual of NMonoid.

Attributes

Companion:
object
Graph
Supertypes
trait PAffine[A]
trait Cosemigroup[A]
class Object
trait Matchable
class Any
object PMaybe

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type
PMaybe.type
trait PMonoid[A] extends Semigroup[A]

A Monoid whose unit can be chained after a signal flowing in the '''P'''ositive direction (Done), effectively taking on the responsibility to wait for completion of some computation.

A Monoid whose unit can be chained after a signal flowing in the '''P'''ositive direction (Done), effectively taking on the responsibility to wait for completion of some computation.

Its dual is NComonoid.

Attributes

Graph
Supertypes
trait Semigroup[A]
class Object
trait Matchable
class Any
object PUnlimited

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type
object Semigroup

Attributes

Companion:
trait
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
trait Semigroup[A]

Attributes

Companion:
object
Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
trait Monoid[A]
trait NMonoid[A]
trait PMonoid[A]
object Signaling

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Attributes

Companion:
trait
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
trait Transportive[F[_]] extends Functor[F]

Attributes

Companion:
object
Graph
Supertypes
trait Functor[-⚬, F]
class Object
trait Matchable
class Any
object Unlimited

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type
object |&|

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type
|&|.type
object |+|

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type
|+|.type

Types

opaque type AcquiredLock
type Bifunctor[F[_, _]] = Bifunctor[-⚬, F]
opaque type Bool
type Comonad[F[_]] = Comonad[-⚬, F]
opaque type Deferred[A]

Like Detained, expresses that interaction with A is (at least partially) obstructed, but does not have the ability to absorb a non-dismissible signal (namely Done)—the signal to resume must be dismissible (namely Ping).

Like Detained, expresses that interaction with A is (at least partially) obstructed, but does not have the ability to absorb a non-dismissible signal (namely Done)—the signal to resume must be dismissible (namely Ping).

Attributes

opaque type Detained[A]

Expresses that interaction with A is (at least partially) obstructed. The detention can be ended by receiving a signal.

Expresses that interaction with A is (at least partially) obstructed. The detention can be ended by receiving a signal.

Equivalent to Need |*| A (or Done =⚬ A if the DSL extends ClosedDSL).

Attributes

opaque type Endless[A]

An endless source of elements, where the consumer decides whether to pull one more element or close. Dual to LList, in which the producer decides how many elements will be produced.

An endless source of elements, where the consumer decides whether to pull one more element or close. Dual to LList, in which the producer decides how many elements will be produced.

Attributes

type Functor[F[_]] = Functor[-⚬, F]
type Id[A] = A
opaque type LList[T]
opaque type LList1[T]

Non-empty list, i.e. a list with at least one element.

Non-empty list, i.e. a list with at least one element.

Attributes

opaque type Lock
opaque type Maybe[A]
type Monad[F[_]] = Monad[-⚬, F]
opaque type Multiple[A]

Zero or more instances of A. The exact multiplicity is determined by the producer.

Zero or more instances of A. The exact multiplicity is determined by the producer.

Similar to LList, but unlike LList, the producer of Multiple is not required to unveil the elements sequentially. There are many different representations (in fact an infinite number) of the same sequence of elements of type A as Multiple[A], while there is only one representation of that sequence as LList[A].

Attributes

opaque type Optionally[A]
opaque type PMaybe[A]
opaque type PUnlimited[A]
opaque type Unlimited[A]

Unlimited supply of As. The consumer chooses how many As to consume.

Unlimited supply of As. The consumer chooses how many As to consume.

Attributes

Value members

Concrete methods

def IV[A, B, C, D](f: B |*| C -⚬ D): A |*| B |*| C -⚬ A |*| D
def IX[A, B, C]: A |*| B |*| C -⚬ A |*| C |*| B
def IXI[A, B, C, D]: A |*| B |*| C |*| D -⚬ A |*| C |*| B |*| D
def [A, B, C, D](f: B -⚬ C |*| D): A |*| B -⚬ A |*| C |*| D

Λ is the uppercase Greek letter lambda.

Λ is the uppercase Greek letter lambda.

Attributes

def VI[A, B, C, D](f: A |*| B -⚬ D): A |*| B |*| C -⚬ D |*| C
def XI[A, B, C]: A |*| B |*| C -⚬ B |*| A |*| C
def awaitChooseL[A, B](implicit A: Negative[A]): A |&| B -⚬ Need |*| A

Chooses the left alternative A of the choice A |&| B, but only after the Need signal from the first out-port arrives. Until then, the producer of A |&| B will see it as undecided. This is different from chooseL[A, B] > awaitNegFst[A], in which the producer of A |&| B knows immediately that the left side is chosen.

Chooses the left alternative A of the choice A |&| B, but only after the Need signal from the first out-port arrives. Until then, the producer of A |&| B will see it as undecided. This is different from chooseL[A, B] > awaitNegFst[A], in which the producer of A |&| B knows immediately that the left side is chosen.

Attributes

def awaitChooseR[A, B](implicit B: Negative[B]): A |&| B -⚬ Need |*| B

Analogous to awaitChooseL, but chooses the right side.

Analogous to awaitChooseL, but chooses the right side.

Attributes

def awaitInjectL[A, B](implicit A: Positive[A]): Done |*| A -⚬ A |+| B

Injects A from the the second in-port to the left side of the |+| in the out-port, but only after the Done signal from the first in-port arrives. That means that the consumer of A |+| B will see it as undecided until the Done signal arrives. This is different from awaitPosFst[A] > injectL[A, B], in which the consumer of A |+| B knows immediately that it is the left case.

Injects A from the the second in-port to the left side of the |+| in the out-port, but only after the Done signal from the first in-port arrives. That means that the consumer of A |+| B will see it as undecided until the Done signal arrives. This is different from awaitPosFst[A] > injectL[A, B], in which the consumer of A |+| B knows immediately that it is the left case.

This is a convenience method on top of injectLWhenDone that which absorbs the Done signal using the given Junction.Positive.

Attributes

def awaitInjectR[A, B](implicit B: Positive[B]): Done |*| B -⚬ A |+| B

Analogous to joinInjectL, but injects to the right.

Analogous to joinInjectL, but injects to the right.

Attributes

def awaitNegFst[A](using A: Negative[A]): A -⚬ Need |*| A
def awaitNegSnd[A](using A: Negative[A]): A -⚬ A |*| Need
def awaitPingFst[A](using A: Positive[A]): Ping |*| A -⚬ A
def awaitPingSnd[A](using A: Positive[A]): A |*| Ping -⚬ A
def awaitPongFst[A](using A: Negative[A]): A -⚬ Pong |*| A
def awaitPongSnd[A](using A: Negative[A]): A -⚬ A |*| Pong
def awaitPosChooseL[A, B](implicit A: Positive[A]): Done |*| A |&| B -⚬ A

Analogous to awaitChooseL, but awaits a positive (i.e. Done) signal.

Analogous to awaitChooseL, but awaits a positive (i.e. Done) signal.

Attributes

def awaitPosChooseR[A, B](implicit B: Positive[B]): Done |*| A |&| B -⚬ B

Analogous to awaitChooseR, but awaits a positive (i.e. Done) signal.

Analogous to awaitChooseR, but awaits a positive (i.e. Done) signal.

Attributes

def awaitPosFst[A](using A: Positive[A]): Done |*| A -⚬ A
def awaitPosSnd[A](using A: Positive[A]): A |*| Done -⚬ A

Obstructs interaction on the in-port (i.e. from the left) until Pong is received.

Obstructs interaction on the in-port (i.e. from the left) until Pong is received.

Attributes

Obstructs interaction on the out-port (i.e. from the right) until Ping is received.

Obstructs interaction on the out-port (i.e. from the right) until Ping is received.

Attributes

def chooseLOnPing[A, B]: Ping |*| A |&| B -⚬ A
def chooseROnPing[A, B]: Ping |*| A |&| B -⚬ B
def combine[A : Semigroup]: A |*| A -⚬ A
def combineMap[A, B, C : Semigroup](f: A -⚬ C, g: B -⚬ C): A |*| B -⚬ C
def compareBy[A, B, K1 : Positive, K2 : PComonoid](aKey: Getter[A, K1], bKey: Getter[B, K2])(implicit evidence$54: PComonoid[K1], evidence$55: Positive[K1], evidence$56: PComonoid[K2], evidence$57: Positive[K2], cmp: Comparable[K1, K2]): A |*| B -⚬ Compared[A, B]
def defer[A](using A: Positive[A]): A -⚬ Deferred[A]
def delayChoiceAndSidesUntilDone[A, B](implicit A: Positive[A], B: Positive[B]): Done |*| A |&| B -⚬ A |&| B
def delayChoiceAndSidesUntilNeed[A, B](implicit A: Negative[A], B: Negative[B]): A |&| B -⚬ Need |*| A |&| B
def delayEitherAndSidesUntilDone[A, B](implicit A: Positive[A], B: Positive[B]): Done |*| A |+| B -⚬ A |+| B
def delayEitherAndSidesUntilNeed[A, B](implicit A: Negative[A], B: Negative[B]): A |+| B -⚬ Need |*| A |+| B
def delayUsing[A](f: Done -⚬ Done)(using A: Positive[A]): A -⚬ A
def delayUsing[A](f: Need -⚬ Need)(using A: Negative[A]): A -⚬ A
def detain[A](using A: Positive[A]): A -⚬ Detained[A]
def discardFst[A, B](implicit A: Comonoid[A]): A |*| B -⚬ B
def discardSnd[A, B](implicit B: Comonoid[B]): A |*| B -⚬ A
def dualRec[F[_], G[_]](ev: Dual1[F, G]): Dual[Rec[F], Rec[G]]

If F[A] is dual to G[B] for all dual pairs A, B, then Rec[F] is dual to Rec[G].

If F[A] is dual to G[B] for all dual pairs A, B, then Rec[F] is dual to Rec[G].

Attributes

def dualSymmetric[A, B](ev: Dual[A, B]): Dual[B, A]
def getFst[A, B](implicit A: Cosemigroup[A]): A |*| B -⚬ A |*| A |*| B
def getSnd[A, B](implicit B: Cosemigroup[B]): A |*| B -⚬ B |*| A |*| B
def injectLOnPong[A, B]: A -⚬ Pong |*| A |+| B
def injectROnPong[A, B]: B -⚬ Pong |*| A |+| B
def lInvert[A, B](implicit ev: Dual[A, B]): One -⚬ B |*| A
def lInvertChoice[A, B, Ȧ, ](lInvertA: One -⚬ Ȧ |*| A, lInvertB: One -⚬ |*| B): One -⚬ Ȧ |&| |*| A |+| B
def lInvertPair[A, B, Ȧ, ](lInvertA: One -⚬ Ȧ |*| A, lInvertB: One -⚬ |*| B): One -⚬ Ȧ |*| |*| A |*| B
def lInvertRec[F[_], G[_]](lInvertSub: [x, y] => (x$1: One -⚬ x |*| y) => One -⚬ F[x] |*| G[y]): One -⚬ Rec[F] |*| Rec[G]
def matchingChoiceLR[A, B, C, D]: A |+| B |*| C |&| D -⚬ A |*| C |+| B |*| D

From the choice ''available'' on the right (C |&| D), choose the one corresponding to the choice ''made'' on the left (A |+| B): if on the left there is A, choose C, if on the left thre is B, choose D.

From the choice ''available'' on the right (C |&| D), choose the one corresponding to the choice ''made'' on the left (A |+| B): if on the left there is A, choose C, if on the left thre is B, choose D.

Attributes

def matchingChoiceRL[A, B, C, D]: A |&| B |*| C |+| D -⚬ A |*| C |+| B |*| D

From the choice ''available'' on the left (A |&| B), choose the one corresponding to the choice ''made'' on the right (C |+| D): if on the right there is C, choose A, if on the right there is D, choose B.

From the choice ''available'' on the left (A |&| B), choose the one corresponding to the choice ''made'' on the right (C |+| D): if on the right there is C, choose A, if on the right there is D, choose B.

Attributes

def notifyChoiceAndLeft[A, B](notifyL: Pong |*| A -⚬ A): Pong |*| A |&| B -⚬ A |&| B

Notifies when the choice (|&amp;|) is made and if it is left, the left side notifies using the given function.

Notifies when the choice (|&amp;|) is made and if it is left, the left side notifies using the given function.

Attributes

def notifyChoiceAndLeft[A, B](using A: Negative[A]): Pong |*| A |&| B -⚬ A |&| B

Notifies when the choice (|&amp;|) is made and if it is left, the left side notifies.

Notifies when the choice (|&amp;|) is made and if it is left, the left side notifies.

Attributes

def notifyChoiceAndRight[A, B](notifyR: Pong |*| B -⚬ B): Pong |*| A |&| B -⚬ A |&| B

Notifies when the choice (|&amp;|) is made and if it is right, the right side notifies using the given function.

Notifies when the choice (|&amp;|) is made and if it is right, the right side notifies using the given function.

Attributes

def notifyChoiceAndRight[A, B](using B: Negative[B]): Pong |*| A |&| B -⚬ A |&| B

Notifies when the choice (|&amp;|) is made and if it is right, the right side notifies.

Notifies when the choice (|&amp;|) is made and if it is right, the right side notifies.

Attributes

def notifyChoiceAndSides[A, B](notifyL: Pong |*| A -⚬ A, notifyR: Pong |*| B -⚬ B): Pong |*| A |&| B -⚬ A |&| B

Notifies when the choice (|&amp;|) is made and the chosen side notifies using the respective given function.

Notifies when the choice (|&amp;|) is made and the chosen side notifies using the respective given function.

Attributes

def notifyChoiceAndSides[A, B](using A: Negative[A], B: Negative[B]): Pong |*| A |&| B -⚬ A |&| B

Notifies when the choice (|&amp;|) is made and the chosen side notifies.

Notifies when the choice (|&amp;|) is made and the chosen side notifies.

Attributes

def notifyEitherAndLeft[A, B](notifyL: A -⚬ Ping |*| A): A |+| B -⚬ Ping |*| A |+| B

Notifies when the |+| is decided and if it is left, the left side notifies using the given function.

Notifies when the |+| is decided and if it is left, the left side notifies using the given function.

Attributes

def notifyEitherAndLeft[A, B](using A: Positive[A]): A |+| B -⚬ Ping |*| A |+| B

Notifies when the |+| is decided and if it is left, the left side notifies.

Notifies when the |+| is decided and if it is left, the left side notifies.

Attributes

def notifyEitherAndRight[A, B](notifyR: B -⚬ Ping |*| B): A |+| B -⚬ Ping |*| A |+| B

Notifies when the |+| is decided and if it is right, the right side notifies using the given function.

Notifies when the |+| is decided and if it is right, the right side notifies using the given function.

Attributes

def notifyEitherAndRight[A, B](using B: Positive[B]): A |+| B -⚬ Ping |*| A |+| B

Notifies when the |+| is decided and if it is right, the right side notifies.

Notifies when the |+| is decided and if it is right, the right side notifies.

Attributes

def notifyEitherAndSides[A, B](notifyL: A -⚬ Ping |*| A, notifyR: B -⚬ Ping |*| B): A |+| B -⚬ Ping |*| A |+| B

Notifies when the |+| is decided and the present side notifies using the respective given function.

Notifies when the |+| is decided and the present side notifies using the respective given function.

Attributes

def notifyEitherAndSides[A, B](using A: Positive[A], B: Positive[B]): A |+| B -⚬ Ping |*| A |+| B

Notifies when the |+| is decided and the present side notifies.

Notifies when the |+| is decided and the present side notifies.

Attributes

def notifyNegFst[A](using A: Negative[A]): Pong |*| A -⚬ A
def notifyNegSnd[A](using A: Negative[A]): A |*| Pong -⚬ A
def notifyPosFst[A](using A: Positive[A]): A -⚬ Ping |*| A
def notifyPosSnd[A](using A: Positive[A]): A -⚬ A |*| Ping
def parFromOne[A, B](f: One -⚬ A, g: One -⚬ B): One -⚬ A |*| B
def parToOne[A, B](f: A -⚬ One, g: B -⚬ One): A |*| B -⚬ One
def pool[A : Positive, Ā](lInvert: One -⚬ Ā |*| A): LList1[A] -⚬ Unlimited[A |*| Ā] |*| LList1[A]

Present a non-empty list of resources A as an unlimited supply of "borrowed" resources A ⊗ Ā, where Ā is the dual of A. A borrowed resource A ⊗ Ā must be "returned" by "annihilating" A and its dual Ā, namely via an inversion on the right A ⊗ Ā -⚬ One. A returned resource will become available for further use when it signals readiness using the Signaling.Positive instance.

Present a non-empty list of resources A as an unlimited supply of "borrowed" resources A ⊗ Ā, where Ā is the dual of A. A borrowed resource A ⊗ Ā must be "returned" by "annihilating" A and its dual Ā, namely via an inversion on the right A ⊗ Ā -⚬ One. A returned resource will become available for further use when it signals readiness using the Signaling.Positive instance.

When all accesses to the pooled resources (obtained via the Unlimited[A |*| Ā] in the first out-port) are closed, the resources are returned in the second out-port.

Attributes

def rInvert[A, B](implicit ev: Dual[A, B]): A |*| B -⚬ One
def rInvertEither[A, B, Ȧ, ](rInvertA: A |*| Ȧ -⚬ One, rInvertB: B |*| -⚬ One): A |+| B |*| Ȧ |&| -⚬ One
def rInvertPair[A, B, Ȧ, ](rInvertA: A |*| Ȧ -⚬ One, rInvertB: B |*| -⚬ One): A |*| B |*| Ȧ |*| -⚬ One
def rInvertRec[F[_], G[_]](rInvertSub: [x, y] => (x$1: x |*| y -⚬ One) => F[x] |*| G[y] -⚬ One): Rec[F] |*| Rec[G] -⚬ One
def race[A, B](implicit A: Positive[A], B: Positive[B]): A |*| B -⚬ A |*| B |+| A |*| B
def race[A : Positive, B : Positive, C](caseFstWins: A |*| B -⚬ C, caseSndWins: A |*| B -⚬ C): A |*| B -⚬ C
def raceAgainstL[A](implicit A: Positive[A]): Done |*| A -⚬ A |+| A
def raceAgainstR[A](implicit A: Positive[A]): A |*| Done -⚬ A |+| A
def raceBy[A, B](notifyA: A -⚬ Ping |*| A, notifyB: B -⚬ Ping |*| B): A |*| B -⚬ A |*| B |+| A |*| B

Races the two Done signals and

Races the two Done signals and

  • produces left if the first signal wins, in which case it returns the second signal that still has to be awaited;
  • produces right if the second signal wins, in which case it returns the first signal that still has to be awaited. It is biased to the left: if both signals have arrived by the time of inquiry, returns left.

Attributes

def raceSignaledOrNot[A](implicit A: Positive[A]): A -⚬ A |+| A
def raceWithL[X, A : Positive, B : Positive, C](caseFstWins: X |*| A |*| B -⚬ C, caseSndWins: X |*| A |*| B -⚬ C): X |*| A |*| B -⚬ C
def raceWithR[A : Positive, B : Positive, Y, C](caseFstWins: A |*| B |*| Y -⚬ C, caseSndWins: A |*| B |*| Y -⚬ C): A |*| B |*| Y -⚬ C
def rec2[A, B, C, D](f: (A -⚬ B, C -⚬ D) => A -⚬ B, g: (A -⚬ B, C -⚬ D) => C -⚬ D): (A -⚬ B, C -⚬ D)

Creates a pair of mutually recursive functions.

Creates a pair of mutually recursive functions.

Attributes

def select[A, B](implicit A: Negative[A], B: Negative[B]): A |*| B |&| A |*| B -⚬ A |*| B
def select[Z, A : Negative, B : Negative](caseFstWins: Z -⚬ A |*| B, caseSndWins: Z -⚬ A |*| B): Z -⚬ A |*| B
def selectAgainstL[A](implicit A: Negative[A]): A |&| A -⚬ Need |*| A
def selectAgainstR[A](implicit A: Negative[A]): A |&| A -⚬ A |*| Need
def selectBy[A, B](notifyA: Pong |*| A -⚬ A, notifyB: Pong |*| B -⚬ B): A |*| B |&| A |*| B -⚬ A |*| B

Races two Need signals, i.e. signals traveling in the negative direction (i.e. opposite the -⚬ arrow). Based on which Need signal from the out-port wins the race, selects one of the two Need signals from the in-port:

Races two Need signals, i.e. signals traveling in the negative direction (i.e. opposite the -⚬ arrow). Based on which Need signal from the out-port wins the race, selects one of the two Need signals from the in-port:

  • If the first signal from the out-port wins the race, selects the left signal from the in-port and pipes to it the remaining (i.e. the right) signal from the out-port.
  • If the second signal from the out-port wins the race, selects the right signal from the in-port and pipes to it the reamining (i.e. the left) signal from the out-port. It is biased to the left: if both signals from the out-port have arrived by the time of inquiry, selects the left signal from the in-port.

Attributes

def selectSignaledOrNot[A](implicit A: Negative[A]): A |&| A -⚬ A
def selectWithL[Z, X, A : Negative, B : Negative](caseFstWins: Z -⚬ X |*| A |*| B, caseSndWins: Z -⚬ X |*| A |*| B): Z -⚬ X |*| A |*| B
def selectWithR[Z, A : Negative, B : Negative, Y](caseFstWins: Z -⚬ A |*| B |*| Y, caseSndWins: Z -⚬ A |*| B |*| Y): Z -⚬ A |*| B |*| Y
def sequence[A : Positive, B : Positive]: A |*| B -⚬ A |*| B

Alias for sequence_PP.

Alias for sequence_PP.

Attributes

def sequence_NN[A, B](using A: Negative[A], B: Negative[B]): A |*| B -⚬ A |*| B
def sequence_NP[A, B](using A: Negative[A], B: Positive[B]): A |*| B -⚬ A |*| B
def sequence_PN[A, B](using A: Positive[A], B: Negative[B]): A |*| B -⚬ A |*| B
def sequence_PP[A, B](using A: Positive[A], B: Positive[B]): A |*| B -⚬ A |*| B
def signalDone[A](using A: Positive[A]): A -⚬ A |*| Done
def signalNegFst[A](using A: Negative[A]): Need |*| A -⚬ A
def signalNegSnd[A](using A: Negative[A]): A |*| Need -⚬ A
def signalPosFst[A](using A: Positive[A]): A -⚬ Done |*| A
def signalPosSnd[A](using A: Positive[A]): A -⚬ A |*| Done
def split[A : Cosemigroup]: A -⚬ A |*| A
def splitMap[A : Cosemigroup, B, C](f: A -⚬ B, g: A -⚬ C): A -⚬ B |*| C
def subordinateFst[A, B, C, D]: A |*| B |&| C |*| D -⚬ A |+| C |*| B |&| D

Present a choice between two pairs ((A |*| B) |&| (C |*| D)) as a choice (B |&| D) between the second parts of the respective pairs and on the side provide the other part of the chosen input pair, i.e. either A or C (A |+| C).

Present a choice between two pairs ((A |*| B) |&| (C |*| D)) as a choice (B |&| D) between the second parts of the respective pairs and on the side provide the other part of the chosen input pair, i.e. either A or C (A |+| C).

Attributes

def subordinateSnd[A, B, C, D]: A |*| B |&| C |*| D -⚬ A |&| C |*| B |+| D

Present a choice between two pairs ((A |*| B) |&| (C |*| D)) as a choice (A |&| C) between the first parts of the respective pairs and on the side provide the other part of the chosen input pair, i.e. either B or D (B |+| D).

Present a choice between two pairs ((A |*| B) |&| (C |*| D)) as a choice (A |&| C) between the first parts of the respective pairs and on the side provide the other part of the chosen input pair, i.e. either B or D (B |+| D).

Attributes

def testBy[A, B, K : Positive](aKey: Getter[A, K], bKey: Getter[B, K], pred: K |*| K -⚬ Bool): A |*| B -⚬ A |*| B |+| A |*| B
def when[A](trigger: $[Done])(f: Done -⚬ A): $[A]
def ΛI[A, B, C, D](f: A -⚬ B |*| C): A |*| D -⚬ B |*| C |*| D

Λ is the uppercase Greek letter lambda.

Λ is the uppercase Greek letter lambda.

Attributes

Concrete fields

val dsl: DSL

Extensions

Extensions

extension [A, B](a: $[A])
def blockUntil(b: $[Ping]): $[A]

Obstructs further interaction until a Ping is received.

Obstructs further interaction until a Ping is received.

Attributes

def deferUntil(b: $[Ping])(implicit A: Positive[A]): $[A]
def sequence(b: $[B])(implicit A: Positive[A], B: Positive[B]): $[A |*| B]
def sequence(f: Done -⚬ B)(implicit A: Positive[A]): $[A |*| B]
def sequenceAfter(b: $[B])(implicit A: Positive[A], B: Positive[B]): $[A |*| B]
def waitFor(b: $[Done])(implicit A: Positive[A]): $[A]
extension [A](a: $[Detained[A]])
def releaseWhen(trigger: $[Done]): $[A]
extension [A](a: $[Deferred[A]])
def resumeWhen(trigger: $[Ping]): $[A]
extension (acquiredLock: $[AcquiredLock])
extension [A, B](f: A -⚬ B)
def /\[C](g: A -⚬ C)(using Cosemigroup[A]): A -⚬ B |*| C

Splits the input and pipes the two halves to the left and right operand.

Splits the input and pipes the two halves to the left and right operand.

Attributes

extension [A, C](f: A -⚬ C)
def \/[B](g: B -⚬ C)(using Semigroup[C]): A |*| B -⚬ C

Combines the outputs of left and right operand.

Combines the outputs of left and right operand.

Attributes

Implicits

Implicits

final implicit def FocusedOnChoiceCo[F[_], B1, B2](f: FocusedCo[F, B1 |&| B2]): FocusedOnChoiceCo[F, B1, B2]
final implicit def FocusedOnChoiceContra[A, F[_], B1, B2](f: FocusedContra[F, B1 |&| B2]): FocusedOnChoiceContra[A, F, B1, B2]
final implicit def FocusedOnDoneTimesCo[F[_], B2](f: FocusedCo[F, Done |*| B2])(implicit j: Positive[B2]): FocusedOnDoneTimesCo[F, B2]
final implicit def FocusedOnPairCo[F[_], B1, B2](f: FocusedCo[F, B1 |*| B2]): FocusedOnPairCo[F, B1, B2]
final implicit def FocusedOnPairContra[A, F[_], B1, B2](f: FocusedContra[F, B1 |*| B2]): FocusedOnPairContra[A, F, B1, B2]
final implicit def FocusedOnPlusCo[F[_], B1, B2](f: FocusedCo[F, B1 |+| B2]): FocusedOnPlusCo[F, B1, B2]
final implicit def FocusedOnPlusContra[A, F[_], B1, B2](f: FocusedContra[F, B1 |+| B2]): FocusedOnPlusContra[A, F, B1, B2]
final implicit def FocusedOnTimesDoneCo[F[_], B1](f: FocusedCo[F, B1 |*| Done])(implicit j: Positive[B1]): FocusedOnTimesDoneCo[F, B1]
final implicit def LinearFunctionOps[A, B](self: A -⚬ B): LinearFunctionOps[A, B]
final implicit def LinearFunctionToPairOps[A, B1, B2](self: A -⚬ B1 |*| B2): LinearFunctionToPairOps[A, B1, B2]
final implicit def LinearFunctionToPlusOps[A, B1, B2](self: A -⚬ B1 |+| B2): LinearFunctionToPlusOps[A, B1, B2]
implicit def choiceEitherDuality[A, B, Ȧ, ](implicit a: Dual[A, Ȧ], b: Dual[B, ]): Dual[A |&| B, Ȧ |+| ]
implicit def doneNeedDuality: Dual[Done, Need]
implicit def eitherChoiceDuality[A, B, Ȧ, ](implicit a: Dual[A, Ȧ], b: Dual[B, ]): Dual[A |+| B, Ȧ |&| ]
implicit def fstFunctor[B]: Transportive[|*|]
implicit val idFunctor: Transportive[Id]
implicit def oneSelfDual: Dual[One, One]
implicit def pairDuality[A, B, Ȧ, ](implicit a: Dual[A, Ȧ], b: Dual[B, ]): Dual[A |*| B, Ȧ |*| ]
implicit def sndFunctor[A]: Transportive[[x] =>> A |*| x]