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

Type members

Classlikes

object AcquiredLock

Attributes

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

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
object Bifunctor

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
Bifunctor.type
object Bool

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
Bool.type
object Closeable

Attributes

Companion
trait
Supertypes
class Object
trait Matchable
class Any
Self type
Closeable.type
trait Closeable[A]

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
Known subtypes

Attributes

Companion
trait
Supertypes
class Object
trait Matchable
class Any
Self type
trait CloseableCosemigroup[A] extends Cosemigroup[A], Closeable[A]

A weaker version of Comonoid where the input cannot be discarded completely, but can be reduced to a signal traveling in the positive direction (Done) that eventually needs to be awaited.

A weaker version of Comonoid where the input cannot be discarded completely, but can be reduced to a signal traveling in the positive direction (Done) that eventually needs to be awaited.

The dual of NMonoid.

Attributes

Companion
object
Supertypes
trait Closeable[A]
trait Cosemigroup[A]
class Object
trait Matchable
class Any
Known subtypes
trait Comparable[A, B]

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
Comparable[A, B]
opaque object Compared

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
Compared.type

Attributes

Companion
trait
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
Supertypes
class Object
trait Matchable
class Any
Self type
object ContraFunctor

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
object Deferrable

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
Deferrable.type
object Deferred

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
Deferred.type
object Detained

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
Detained.type
object Dual

Attributes

Companion
trait
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
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object doneNeedDuality.type
object given_Dual_One_One.type
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

Supertypes
class Object
trait Matchable
class Any
object Endless

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
Endless.type
object Externalizer

Attributes

Companion
trait
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
Supertypes
class Object
trait Matchable
class Any
Self type
class FocusedBi[F[_, _], B1, B2](f: F[B1, B2])(F: BiExternalizer[F])

Attributes

Supertypes
class Object
trait Matchable
class Any
class FocusedCo[F[_], B](f: F[B])(using 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

Supertypes
class Object
trait Matchable
class Any
class FocusedContra[F[_], B](f: F[B])(using 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

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

Attributes

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

Extends the focus to the left/right side of the (currently focused) consumer choice.

Extends the focus to the left/right side of the (currently focused) consumer choice.

Attributes

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

Attributes

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

Attributes

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

Attributes

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

Extends the focus to the left/right side of the (currently focused) producer choice.

Extends the focus to the left/right side of the (currently focused) producer choice.

Attributes

Supertypes
class Object
trait Matchable
class Any
object Functor

Attributes

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

Attributes

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

Attributes

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

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
Junction.type
object LList

Attributes

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

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
LList1.type
object Lease

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
Lease.type
object LeasePool

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
LeasePool.type
object Lens

Attributes

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

Attributes

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

Attributes

Supertypes
class Object
trait Matchable
class Any
object Lock

Attributes

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

Attributes

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

Attributes

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

Attributes

Companion
object
Supertypes
trait Semigroup[A]
class Object
trait Matchable
class Any
Known subtypes
object given_Monoid_Done.type
object given_Monoid_One.type
object given_Monoid_Ping.type
object Multiple

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
Multiple.type
object NAffine

Attributes

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

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
Known subtypes
trait NComonoid[A]
trait NComonoid[A] extends Cosemigroup[A], 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

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

Attributes

Companion
trait
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
Supertypes
trait Semigroup[A]
class Object
trait Matchable
class Any
Known subtypes
object given_NMonoid_Need.type
object Optionally

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
Optionally.type
object PMaybe

Attributes

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

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

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
PUnlimited.type
object Semigroup

Attributes

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

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
Known subtypes
trait Monoid[A]
object given_Monoid_Done.type
object given_Monoid_One.type
object given_Monoid_Ping.type
trait NMonoid[A]
object given_NMonoid_Need.type
trait PMonoid[A]
object given_Semigroup_Done.type
object given_Semigroup_Need.type
object given_Semigroup_Ping.type
object given_Semigroup_Pong.type
Show all
object Signaling

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
Signaling.type

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
object Transportive

Attributes

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

Attributes

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

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
Unlimited.type
object doneNeedDuality extends Dual[Done, Need]

Attributes

Supertypes
trait Dual[Done, Need]
class Object
trait Matchable
class Any
Self type
object given_Dual_One_One extends Dual[One, One]

Attributes

Supertypes
trait Dual[One, One]
class Object
trait Matchable
class Any
Self type

Attributes

Supertypes
trait Transportive[Id]
trait Functor[-⚬, Id]
class Object
trait Matchable
class Any
Self type
object |&|

Attributes

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

Attributes

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]
type ContraFunctor[F[_]] = ContraFunctor[-⚬, 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 the intent that interaction with A is (at least partially) obstructed. The detention can be ended by receiving a signal.

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

Note that whether/how much the interaction with Detained[A] is actually obstructed is completely up to the producer of Detained[A].

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 Lease
opaque type LeasePool
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](using 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](using 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](using 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](using 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](using 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](using 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 chooseLWhenDone[A, B]: Done |*| A |&| B -⚬ Done |*| A
def chooseLWhenNeed[A, B]: Need |*| A |&| B -⚬ Need |*| A
def chooseROnPing[A, B]: Ping |*| A |&| B -⚬ B
def chooseRWhenDone[A, B]: Done |*| A |&| B -⚬ Done |*| B
def chooseRWhenNeed[A, B]: A |&| Need |*| B -⚬ Need |*| 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 : Positive](aKey: Getter[A, K1], bKey: Getter[B, K2])(implicit evidence$17: CloseableCosemigroup[K1], evidence$18: Positive[K1], evidence$19: CloseableCosemigroup[K2], evidence$20: 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](using A: Positive[A], B: Positive[B]): Done |*| A |&| B -⚬ A |&| B
def delayChoiceAndSidesUntilNeed[A, B](using A: Negative[A], B: Negative[B]): A |&| B -⚬ Need |*| A |&| B
def delayChoiceUntilPing[A, B]: Ping |*| A |&| B -⚬ A |&| B
def delayChoiceUntilPong[A, B]: A |&| B -⚬ Pong |*| A |&| B
def delayEitherAndSidesUntilDone[A, B](using A: Positive[A], B: Positive[B]): Done |*| A |+| B -⚬ A |+| B
def delayEitherAndSidesUntilNeed[A, B](using A: Negative[A], B: Negative[B]): A |+| B -⚬ Need |*| A |+| B
def delayEitherUntilPing[A, B]: Ping |*| A |+| B -⚬ A |+| B
def delayEitherUntilPong[A, B]: A |+| B -⚬ Pong |*| 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](using A: Comonoid[A]): A |*| B -⚬ B
def discardSnd[A, B](using 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](using A: Cosemigroup[A]): A |*| B -⚬ A |*| A |*| B
def getSnd[A, B](using B: Cosemigroup[B]): A |*| B -⚬ B |*| A |*| B
def injectLOnPong[A, B]: A -⚬ Pong |*| A |+| B
def injectLWhenDone[A, B]: Done |*| A -⚬ Done |*| A |+| B
def injectLWhenNeed[A, B]: Need |*| A -⚬ Need |*| A |+| B
def injectROnPong[A, B]: B -⚬ Pong |*| A |+| B
def injectRWhenDone[A, B]: Done |*| B -⚬ A |+| Done |*| B
def injectRWhenNeed[A, B]: Need |*| B -⚬ Need |*| A |+| B
def lInvert[A, B](using 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 listEndlessDuality[A, Ā](ev: Dual[A, Ā]): Dual[LList[A], Endless[Ā]]
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 rInvert[A, B](using 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](using A: Positive[A], B: Positive[B]): A |*| B -⚬ A |*| B |+| A |*| B
def raceAgainstL[A](using A: Positive[A]): Done |*| A -⚬ A |+| A
def raceAgainstR[A](using 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
def raceBy[A](notify: A -⚬ Ping |*| A): A |*| A -⚬ A |*| A |+| A |*| A

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 raceHandicap[A, B, C](f: Ping |*| B -⚬ C)(using A: Positive[A], C: Positive[C]): A |*| Ping |*| B -⚬ A |*| B |+| A |*| C |+| A |*| C
def racePreferred[A, B](using A: Positive[A], B: Positive[B]): Ping |*| A |*| B -⚬ A |*| B |+| A |*| B
def raceSwitch[A : Positive, B : Positive, C](caseFstWins: A |*| B -⚬ C, caseSndWins: A |*| B -⚬ C): A |*| B -⚬ C
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 rec2[A, B, C, D](fs: (A -⚬ B, C -⚬ D) => (A -⚬ B, C -⚬ D)): (A -⚬ B, C -⚬ D)
def rec3[A, B, C, D, E, F](f: (A -⚬ B, C -⚬ D, E -⚬ F) => A -⚬ B, g: (A -⚬ B, C -⚬ D, E -⚬ F) => C -⚬ D, h: (A -⚬ B, C -⚬ D, E -⚬ F) => E -⚬ F): (A -⚬ B, C -⚬ D, E -⚬ F)
def rec3[A, B, C, D, E, F](fs: (A -⚬ B, C -⚬ D, E -⚬ F) => (A -⚬ B, C -⚬ D, E -⚬ F)): (A -⚬ B, C -⚬ D, E -⚬ F)
def select[A, B](using 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](using A: Negative[A]): A |&| A -⚬ Need |*| A
def selectAgainstR[A](using 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
def selectBy[A](notify: Pong |*| A -⚬ A): A |*| A |&| A |*| A -⚬ A |*| A

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 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)(using LambdaContext): $[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 category: Category[-⚬]
val dsl: DSL

Givens

Givens

given choiceEitherDuality[A, B, Ȧ, ](using a: Dual[A, Ȧ], b: Dual[B, ]): Dual[A |&| B, Ȧ |+| ]
given eitherChoiceDuality[A, B, Ȧ, ](using a: Dual[A, Ȧ], b: Dual[B, ]): eitherChoiceDuality[A, B, Ȧ, ]
given pairDuality[A, B, Ȧ, ](using a: Dual[A, Ȧ], b: Dual[B, ]): pairDuality[A, B, Ȧ, ]
given sndFunctor[A]: Transportive[[x] =>> A |*| x]

Extensions

Extensions

extension [A](a: $[Detained[A]])
def releaseWhen(trigger: $[Done])(using LambdaContext): $[A]
extension [A](a: $[Deferred[A]])
def resumeWhen(trigger: $[Ping])(using LambdaContext): $[A]
extension [A, B](a: $[A])(using LambdaContext)
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])(using A: Positive[A]): $[A]
def sequence(b: $[B])(using A: Positive[A], B: Positive[B]): $[A |*| B]
def sequence(f: Done -⚬ B)(using A: Positive[A]): $[A |*| B]
def sequenceAfter(b: $[B])(using A: Positive[A], B: Positive[B]): $[A |*| B]
def waitFor(b: $[Done])(using A: Positive[A]): $[A]
extension (acquiredLock: $[AcquiredLock])(using LambdaContext)
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

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

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]

Extends the focus to the left/right side of the (currently focused) consumer choice.

Extends the focus to the left/right side of the (currently focused) consumer choice.

Attributes

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]

Extends the focus to the left/right side of the (currently focused) producer choice.

Extends the focus to the left/right side of the (currently focused) producer choice.

Attributes

final implicit def LinearFunctionOps[A, B](self: A -⚬ B): LinearFunctionOps[A, B]