- Companion
- object
Type members
Classlikes
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.
- Companion
- object
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 ┃
┗━━━━━┛ ┗━━━━━┛
- Companion
- object
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.
- Companion
- object
Focused on B in the output F[B] of linear function A -⚬ F[B], where B is in a contravariant position.
Types
A type alias expressing the ''intent'' that A is delayed (in some sense) until a signal (Need) is received.
Equivalent to Done =⚬ A, but the formulation as Need |*| A does not rely on the more powerful concept
of ''function types'' (internal hom objects), i.e. does not require ClosedDSL.
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].
Value members
Methods
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.
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.
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 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.
Creates a pair of mutually recursive functions.
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).