ClosedLib

libretto.ClosedLib
See theClosedLib companion object
class ClosedLib[DSL <: ClosedDSL, CLib <: CoreLib[DSL]](val dsl: DSL, val coreLib: CLib & CoreLib[DSL])

Attributes

Companion
object
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
ClosedLib[DSL, CLib]

Members list

Value members

Concrete methods

def absorbR[A, B, C]: A =⚬ B |*| C -⚬ A =⚬ B |*| C

Make a function A =⚬ B ''"absorb"'' a C and return it as part of its output, i.e. A =⚬ (B |*| C).

Make a function A =⚬ B ''"absorb"'' a C and return it as part of its output, i.e. A =⚬ (B |*| C).

Attributes

Function object (internal hom) is contravariant in the input type.

Function object (internal hom) is contravariant in the input type.

Attributes

def output[A]: Functor[[x] =>> A =⚬ x]

Function object (internal hom) is covariant in the output type.

Function object (internal hom) is covariant in the output type.

Attributes

def unveilSequentially[A, Ā, B](using ev: Dual[A, Ā]): A |*| B -⚬ Ā =⚬ B

Given A and B concurrently (A |*| B), we can suggest that A be consumed before B by turning it into Ā =⚬ B, where Ā is the dual of A.

Given A and B concurrently (A |*| B), we can suggest that A be consumed before B by turning it into Ā =⚬ B, where Ā is the dual of A.

Attributes

def zapPremises[A, Ā, B, C](using ev: Dual[A, Ā]): A =⚬ B |*| Ā =⚬ C -⚬ B |*| C

Concrete fields

val coreLib: CLib & CoreLib[DSL]
val dsl: DSL

Extensions

Extensions

extension [A, B](f: A -⚬ B)
def curry[A1, A2](using ev: A =:= A1 |*| A2): A1 -⚬ A2 =⚬ B
def uncurry[B1, B2](using ev: B =:= B1 =⚬ B2): A |*| B1 -⚬ B2
extension [F[_], A, B](f: FocusedCo[F, A =⚬ B])
def input: FocusedContra[F, A]
def output: FocusedCo[[x] =>> F[A =⚬ x], B]
extension [F[_], A, B](f: FocusedContra[F, A =⚬ B])
def input: FocusedCo[F, A]
def output: FocusedContra[[x] =>> F[A =⚬ x], B]