Scaletto

libretto.scaletto.Scaletto
trait Scaletto extends Puro, TimerDSL, CrashDSL

Supports manipulating Scala values via pure Scala functions. Also extends TimerDSL and CrashDSL, since these are expected to be possible on a target platform that already supports Scala functions.

Attributes

Graph
Supertypes
trait CrashDSL
trait TimerDSL
trait Puro
class Object
trait Matchable
class Any
Show all
Known subtypes
object FreeScaletto

Members list

Type members

Classlikes

trait ScalaFuns

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
object ScalaFun
trait UInt31Scaletto extends UInt31s

Attributes

Supertypes
trait UInt31s
class Object
trait Matchable
class Any
Known subtypes
object UInt31
class ValSwitch[A, A0, R](a: $[Val[A]], pos: SourcePos, cases: Cases[A, A0, R])(using x$4: LambdaContext)

Type parameters

A

type of the scrutinee (the value to match on)

A0

subtype of A covered so far

R

result type that each case must produce

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
object ValSwitch

Attributes

Companion
class
Supertypes
class Object
trait Matchable
class Any
Self type
ValSwitch.type
class ValSwitchInit[A](a: $[Val[A]], pos: SourcePos)(using x$3: LambdaContext)

Attributes

Supertypes
class Object
trait Matchable
class Any
class ValSwitchInitCase[A, A0 <: A](a: $[Val[A]], pos: SourcePos, tt: TypeTest[A, A0], casePos: SourcePos)(using x$5: LambdaContext)

Attributes

Supertypes
class Object
trait Matchable
class Any

Inherited classlikes

trait $Ops

Attributes

Inherited from:
Puro
Supertypes
class Object
trait Matchable
class Any
object *

Attributes

Inherited from:
Puro
Supertypes
class Object
trait Matchable
class Any
object +

Attributes

Inherited from:
Puro
Supertypes
class Object
trait Matchable
class Any
object -

Attributes

Inherited from:
Puro
Supertypes
class Object
trait Matchable
class Any
object --

Attributes

Inherited from:
Puro
Supertypes
class Object
trait Matchable
class Any
object ?

Attributes

Inherited from:
Puro
Supertypes
class Object
trait Matchable
class Any
trait ClosureOps

Attributes

Inherited from:
Puro
Supertypes
class Object
trait Matchable
class Any
trait Comonoid[A] extends Comonoid[-⚬, |*|, One, A], Cosemigroup[A]

Attributes

Inherited from:
Puro
Supertypes
trait Cosemigroup[A]
trait Comonoid[-⚬, |*|, One, A]
trait Affine[-⚬, One, A]
trait Cosemigroup[-⚬, |*|, A]
class Object
trait Matchable
class Any
Show all
Known subtypes
object comonoidNeed
object comonoidOne
object comonoidPing
object comonoidPong

Attributes

Inherited from:
Puro
Supertypes
class Object
trait Matchable
class Any
trait Cosemigroup[A] extends Cosemigroup[-⚬, |*|, A]

Attributes

Inherited from:
Puro
Supertypes
trait Cosemigroup[-⚬, |*|, A]
class Object
trait Matchable
class Any
Known subtypes
trait Comonoid[A]
object comonoidNeed
object comonoidOne
object comonoidPing
object comonoidPong
trait NComonoid[A]
Show all
trait LambdaOps

Attributes

Inherited from:
Puro
Supertypes
class Object
trait Matchable
class Any
class Switch[A, R](ctx: LambdaContext, pos: SourcePos, a: $[A], cases: List[(SourcePos, LambdaContext ?=> $[A] => $[R])])

Attributes

Inherited from:
Puro
Supertypes
class Object
trait Matchable
class Any
class SwitchInit[A](ctx: LambdaContext, switchPos: SourcePos, a: $[A])

Attributes

Inherited from:
Puro
Supertypes
class Object
trait Matchable
class Any
trait UInt31s

Attributes

Inherited from:
Puro
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object UInt31
object comonoidNeed extends Comonoid[Need]

Attributes

Inherited from:
Puro
Supertypes
trait Comonoid[Need]
trait Cosemigroup[Need]
trait Comonoid[-⚬, |*|, One, Need]
trait Affine[-⚬, One, Need]
class Object
trait Matchable
class Any
Show all
object comonoidOne extends Comonoid[One]

Attributes

Inherited from:
Puro
Supertypes
trait Comonoid[One]
trait Cosemigroup[One]
trait Comonoid[-⚬, |*|, One, One]
trait Affine[-⚬, One, One]
trait Cosemigroup[-⚬, |*|, One]
class Object
trait Matchable
class Any
Show all
object comonoidPing extends Comonoid[Ping]

Attributes

Inherited from:
Puro
Supertypes
trait Comonoid[Ping]
trait Cosemigroup[Ping]
trait Comonoid[-⚬, |*|, One, Ping]
trait Affine[-⚬, One, Ping]
class Object
trait Matchable
class Any
Show all
object comonoidPong extends Comonoid[Pong]

Attributes

Inherited from:
Puro
Supertypes
trait Comonoid[Pong]
trait Cosemigroup[Pong]
trait Comonoid[-⚬, |*|, One, Pong]
trait Affine[-⚬, One, Pong]
class Object
trait Matchable
class Any
Show all
object cosemigroupDone extends Cosemigroup[Done]

Attributes

Inherited from:
Puro
Supertypes
trait Cosemigroup[Done]
class Object
trait Matchable
class Any
object cosemigroupNeed extends Cosemigroup[Need]

Attributes

Inherited from:
Puro
Supertypes
trait Cosemigroup[Need]
class Object
trait Matchable
class Any
object cosemigroupPing extends Cosemigroup[Ping]

Attributes

Inherited from:
Puro
Supertypes
trait Cosemigroup[Ping]
class Object
trait Matchable
class Any
object cosemigroupPong extends Cosemigroup[Pong]

Attributes

Inherited from:
Puro
Supertypes
trait Cosemigroup[Pong]
class Object
trait Matchable
class Any
object producing

Attributes

Inherited from:
Puro
Supertypes
class Object
trait Matchable
class Any

Types

type Neg[A] = -[Val[A]]

Demand for a Scala value of type A.

Demand for a Scala value of type A.

Somewhat analogous to scala.concurrent.Promise

Attributes

type Res[A]

Resource that is a Scala object of type A. Unlike Val, a resource can be mutable, cannot in general be neglected or duplicated, and is automatically cleaned-up in case of crash.

Resource that is a Scala object of type A. Unlike Val, a resource can be mutable, cannot in general be neglected or duplicated, and is automatically cleaned-up in case of crash.

It is recommended to define custom opaque type aliases of resources, such as

opaque type Input = Res[java.io.InputStream]

Attributes

type ScalaFun[A, B]
type Val[A]

Scala value of type A.

Scala value of type A.

Somewhat analogous to scala.concurrent.Future.

Attributes

Inherited types

type =⚬[A, B] = -[A] |*| B

Function object (a.k.a. internal hom), internal to the DSL, that is, a function that can be on the input or output of a linear function (-⚬). It must itself be used linearly (i.e. exactly once). While A -⚬ B is a morphism in a category, A =⚬ B is an object in the category. Existence of all function objects (internal homs) makes -⚬ a closed monoidal category. In fact, it follows from the existence of inversions: A =⚬ B can be defined as -[A] |*| B.

Function object (a.k.a. internal hom), internal to the DSL, that is, a function that can be on the input or output of a linear function (-⚬). It must itself be used linearly (i.e. exactly once). While A -⚬ B is a morphism in a category, A =⚬ B is an object in the category. Existence of all function objects (internal homs) makes -⚬ a closed monoidal category. In fact, it follows from the existence of inversions: A =⚬ B can be defined as -[A] |*| B.

Attributes

Inherited from:
Puro
type Affine[A] = Affine[-⚬, One, A]

Attributes

Inherited from:
Puro
type [A, B] = A |+| B

Alias for |+|.

Alias for |+|.

Attributes

Inherited from:
Puro
type [A, B] = A |*| B

Alias for |*|.

Alias for |*|.

Attributes

Inherited from:
Puro

Inherited and Abstract types

type $[A]

The type of auxiliary placeholder variables used in construction of λ-expressions.

The type of auxiliary placeholder variables used in construction of λ-expressions.

Attributes

Inherited from:
Puro
type -[A]

-[A] is a "demand" for A.

-[A] is a "demand" for A.

Inverts the flow of information: whatever travels through A in one direction, travels through -[A] in the opposite direction.

Attributes

Inherited from:
Puro
type -⚬[A, B]

Libretto arrow, also called a ''component'' or a ''linear function''.

Libretto arrow, also called a ''component'' or a ''linear function''.

┏━━━━━━━━━━┓
┞───┐      ┞───┐
╎ A │      ╎ B │
┟───┘      ┟───┘
┗━━━━━━━━━━┛

In A -⚬ B, we say that the ''in-port'' is of type A and the ''out-port'' is of type B. Note that the distinction between the in-port and the out-port is only formal. Information or resources may flow in and out through both the in-port and the out-port.

"Linear" means that each input is ''consumed'' exactly once, in particular, it cannot be ignored or used twice.

Attributes

Inherited from:
Puro
type ::[Label, T]

Used to describe named fields: "label" :: Type.

Used to describe named fields: "label" :: Type.

Attributes

Inherited from:
Puro
opaque type ??[A]

Attributes

Inherited from:
Puro
type AssemblyError <: Throwable

Attributes

Inherited from:
Puro
type Done

Signal that travels in the direction of -⚬, i.e. the positive direction. It may signal completion of a (potentially effectful) computation. It cannot be ignored. (If this signal was the only handle to an (effectful) computation, ignoring it would mean losing track of that computation, which is considered to be a resource leak.)

Signal that travels in the direction of -⚬, i.e. the positive direction. It may signal completion of a (potentially effectful) computation. It cannot be ignored. (If this signal was the only handle to an (effectful) computation, ignoring it would mean losing track of that computation, which is considered to be a resource leak.)

Attributes

Inherited from:
Puro
type LTerminus

A black hole that can absorb (i.e. take over the responsibility to await) Need signals, but from which there is no escape.

A black hole that can absorb (i.e. take over the responsibility to await) Need signals, but from which there is no escape.

Attributes

Inherited from:
Puro

Attributes

Inherited from:
Puro
type Need

Signal that travels in the direction opposite to -⚬, i.e. the negative direction. It may signal completion of a (potentially effectful) computation. It cannot be ignored. (If this signal was the only handle to an (effectful) computation, ignoring it would mean losing track of that computation, which is considered to be a resource leak.)

Signal that travels in the direction opposite to -⚬, i.e. the negative direction. It may signal completion of a (potentially effectful) computation. It cannot be ignored. (If this signal was the only handle to an (effectful) computation, ignoring it would mean losing track of that computation, which is considered to be a resource leak.)

Attributes

Inherited from:
Puro
type One

No resource. It is the identity element for |*|. There is no flow of information through a One-typed port.

No resource. It is the identity element for |*|. There is no flow of information through a One-typed port.

Attributes

Inherited from:
Puro
type OneOf[Cases]

Attributes

Inherited from:
Puro
type Ping

Signal that travels in the direction of -⚬, i.e. the positive direction. [Unlike Done, it cannot be the only handle to an effectful computation. As such, it can be ignored, e.g. as the losing contestant in racePair.

Signal that travels in the direction of -⚬, i.e. the positive direction. [Unlike Done, it cannot be the only handle to an effectful computation. As such, it can be ignored, e.g. as the losing contestant in racePair.

Attributes

Inherited from:
Puro
type Pong

Signal that travels in the direction opposite to -⚬, i.e. the negative direction. Unlike Need, it cannot be the only handle to an effectful computation. As such, it can be ignored, e.g. as the losing contestant in selectPair.

Signal that travels in the direction opposite to -⚬, i.e. the negative direction. Unlike Need, it cannot be the only handle to an effectful computation. As such, it can be ignored, e.g. as the losing contestant in selectPair.

Attributes

Inherited from:
Puro
type RTerminus

A black hole that can absorb (i.e. take over the responsibility to await) Done signals, but from which there is no escape.

A black hole that can absorb (i.e. take over the responsibility to await) Done signals, but from which there is no escape.

Attributes

Inherited from:
Puro
type Rec[F[_]]

Used to define recursive types.

Used to define recursive types.

Attributes

Inherited from:
Puro
type Sub[A, B]

Represents a callable subroutine (subprogram) accessible from inside the program.

Represents a callable subroutine (subprogram) accessible from inside the program.

It can be used (called) any number of times. As such, it is a more convenient equivalent of Unlimited[A =⚬ B], with an extension method to invoke the subroutine.

Attributes

Inherited from:
Puro
type UInt31

Unsigned (i.e. non-negative) integer up to 31 bits. Behavior on overflow is undefined.

Unsigned (i.e. non-negative) integer up to 31 bits. Behavior on overflow is undefined.

Attributes

Inherited from:
Puro
type Void

Impossible resource. Analogous to Nothing. It is the identity element for |+|.

Impossible resource. Analogous to Nothing. It is the identity element for |+|.

Attributes

Inherited from:
Puro
type |&|[A, B]

Choice between A and B. The consumer chooses whether to get A or B (but can get only one of them). The producer has to be ready to provide either of them.

Choice between A and B. The consumer chooses whether to get A or B (but can get only one of them). The producer has to be ready to provide either of them.

Attributes

Inherited from:
Puro
type |*|[A, B]

Concurrent pair. Also called a ''tensor product'' or simply ''times''.

Concurrent pair. Also called a ''tensor product'' or simply ''times''.

Attributes

Inherited from:
Puro
type |+|[A, B]

Either A or B. Analogous to scala.Either. Whether it is going to be A or B is decided by the producer. The consumer has to be ready to handle either of the two cases.

Either A or B. Analogous to scala.Either. Whether it is going to be A or B is decided by the producer. The consumer has to be ready to handle either of the two cases.

Attributes

Inherited from:
Puro
type ||[A, B]

Delimiter of fields in n-ary typedefs.

Delimiter of fields in n-ary typedefs.

Attributes

Inherited from:
Puro

Value members

Abstract methods

def acquire[A, R, B](acquire: ScalaFun[A, (R, B)], release: Option[ScalaFun[R, Unit]]): Val[A] -⚬ (Res[R] |*| Val[B])
def constNeg[A](a: A): Neg[A] -⚬ Need
def constVal[A](a: A): Done -⚬ Val[A]
def debugPrint(msg: String): Ping -⚬ One

Prints the given message to the console, without creating an obligation to await.

Prints the given message to the console, without creating an obligation to await.

Attributes

def delay: Val[FiniteDuration] -⚬ Done
def effect[R, A, B](f: ScalaFun[(R, A), B]): (Res[R] |*| Val[A]) -⚬ (Res[R] |*| Val[B])
def effectWr[R, A](f: ScalaFun[(R, A), Unit]): (Res[R] |*| Val[A]) -⚬ Res[R]
def liftEither[A, B]: Val[Either[A, B]] -⚬ (Val[A] |+| Val[B])
def liftPair[A, B]: Val[(A, B)] -⚬ (Val[A] |*| Val[B])
def mapVal[A, B](f: ScalaFun[A, B]): Val[A] -⚬ Val[B]
def neglect[A]: Val[A] -⚬ Done
def notifyNeg[A]: (Pong |*| Neg[A]) -⚬ Neg[A]
def notifyVal[A]: Val[A] -⚬ (Ping |*| Val[A])
def release[R]: Res[R] -⚬ Done

Releases a resource using the release function registered during resource acquisition.

Releases a resource using the release function registered during resource acquisition.

Attributes

def releaseWith[R, A, B](f: ScalaFun[(R, A), B]): (Res[R] |*| Val[A]) -⚬ Val[B]
def sizeOf[A, B](f: A -⚬ B): Long

Returns the size of the given program, in further unspecified units. Useful only for approximate relative comparisons.

Returns the size of the given program, in further unspecified units. Useful only for approximate relative comparisons.

Attributes

def switchVal[A, R](a: $[Val[A]], cases: Cases[A, A, R])(pos: SourcePos)(using LambdaContext): $[R]
def tryAcquire[A, R, B, E](acquire: ScalaFun[A, Either[E, (R, B)]], release: Option[ScalaFun[R, Unit]]): Val[A] -⚬ (Val[E] |+| (Res[R] |*| Val[B]))
def tryEffectAcquire[R, A, S, B, E](f: ScalaFun[(R, A), Either[E, (S, B)]], release: Option[ScalaFun[S, Unit]]): (Res[R] |*| Val[A]) -⚬ (Res[R] |*| (Val[E] |+| (Res[S] |*| Val[B])))
def trySplitResource[R, A, S, T, B, E](f: ScalaFun[(R, A), Either[E, (S, T, B)]], release1: Option[ScalaFun[S, Unit]], release2: Option[ScalaFun[T, Unit]]): (Res[R] |*| Val[A]) -⚬ (Val[E] |+| (Res[S] |*| Res[T] |*| Val[B]))
def tryTransformResource[R, A, S, B, E](f: ScalaFun[(R, A), Either[E, (S, B)]], release: Option[ScalaFun[S, Unit]]): (Res[R] |*| Val[A]) -⚬ (Val[E] |+| (Res[S] |*| Val[B]))
def unliftPair[A, B]: (Val[A] |*| Val[B]) -⚬ Val[(A, B)]

Concrete methods

def acquire[A, R, B](acquire: A => (R, B), release: Option[R => Unit]): Val[A] -⚬ (Res[R] |*| Val[B])

Acquires a resource of type R.

Acquires a resource of type R.

Type parameters

A

parameters of the acquire function

B

additional data produced by acquiring the resource

R

type of the resource

Value parameters

release

called to release the resource in case of a crash. None means no cleanup is needed

Attributes

def acquireAsync[A, R, B](acquire: A => Async[(R, B)], release: Option[R => Async[Unit]]): Val[A] -⚬ (Res[R] |*| Val[B])
def blocking[A, B](f: A => B): Val[A] -⚬ Val[B]

Executes a potentially blocking operation. The runtime will ensure that the blocking operation does not impede any of the concurrently happening non-blocking computations.

Executes a potentially blocking operation. The runtime will ensure that the blocking operation does not impede any of the concurrently happening non-blocking computations.

Attributes

transparent inline def constNeg[A]: Neg[A] -⚬ Need
transparent inline def constVal[A]: Done -⚬ Val[A]
def constantVal[A](a: A)(using SourcePos, LambdaContext): $[Val[A]]
def contramapNeg[A, B](f: A => B): Neg[B] -⚬ Neg[A]

Lifts an ordinary Scala function to a linear function on demands, in opposite direction.

Lifts an ordinary Scala function to a linear function on demands, in opposite direction.

Attributes

override def delay(d: FiniteDuration): Done -⚬ Done

Attributes

Definition Classes
def delayNeed: Need -⚬ Neg[FiniteDuration]
def dup[A]: Val[A] -⚬ (Val[A] |*| Val[A])
def dupNeg[A]: (Neg[A] |*| Neg[A]) -⚬ Neg[A]
def effect[R, A, B](f: (R, A) => B): (Res[R] |*| Val[A]) -⚬ (Res[R] |*| Val[B])

Performs a (potentially) effectful operation on a resource, producing some output.

Performs a (potentially) effectful operation on a resource, producing some output.

Type parameters

A

additional parameter of the operation

B

additional output of the operation

R

type of the resource

Value parameters

f

the effectful operation

Attributes

def effectAsync[R, A, B](f: (R, A) => Async[B]): (Res[R] |*| Val[A]) -⚬ (Res[R] |*| Val[B])
def effectWr[R, A](f: (R, A) => Unit): (Res[R] |*| Val[A]) -⚬ Res[R]

Variant of effect that does not produce output in addition to performing the effect. Can be viewed as ''wr''iting an A into the resource.

Variant of effect that does not produce output in addition to performing the effect. Can be viewed as ''wr''iting an A into the resource.

Attributes

def effectWrAsync[R, A](f: (R, A) => Async[Unit]): (Res[R] |*| Val[A]) -⚬ Res[R]
def fulfill[A]: (Val[A] |*| Neg[A]) -⚬ One

Uses the value (eventually) produced by Val to satisfy the demand of Neg.

Uses the value (eventually) produced by Val to satisfy the demand of Neg.

Attributes

def inflate[A]: Need -⚬ Neg[A]
def liftNegPair[A, B]: Neg[(A, B)] -⚬ (Neg[A] |*| Neg[B])
def mapVal[A, B](f: A => B): Val[A] -⚬ Val[B]

Lifts an ordinary Scala function to a linear function on Vals.

Lifts an ordinary Scala function to a linear function on Vals.

Attributes

def promise[A]: One -⚬ (Neg[A] |*| Val[A])

Creates an entangled pair of demand (Neg) and supply (Val) such that when the demand is fulfilled with a value, that value will be produced by the supply.

Creates an entangled pair of demand (Neg) and supply (Val) such that when the demand is fulfilled with a value, that value will be produced by the supply.

Attributes

def release[R, A, B](f: (R, A) => B): (Res[R] |*| Val[A]) -⚬ Val[B]

Releases a resource using the given function. The release function previously registered during resource acquisition is not used.

Releases a resource using the given function. The release function previously registered during resource acquisition is not used.

Type parameters

A

additional parameter of the release function

B

additional data produced by the release function

R

type of the resource

Value parameters

f

the release function

Attributes

def releaseAsync[R, A, B](f: (R, A) => Async[B]): (Res[R] |*| Val[A]) -⚬ Val[B]
def splitResource[R, A, S, T, B](f: ScalaFun[(R, A), (S, T, B)], release1: Option[ScalaFun[S, Unit]], release2: Option[ScalaFun[T, Unit]]): (Res[R] |*| Val[A]) -⚬ (Res[S] |*| Res[T] |*| Val[B])
def splitResource[R, A, S, T, B](f: (R, A) => (S, T, B), release1: Option[S => Unit], release2: Option[T => Unit]): (Res[R] |*| Val[A]) -⚬ (Res[S] |*| Res[T] |*| Val[B])
def splitResourceAsync[R, A, S, T, B](f: (R, A) => Async[(S, T, B)], release1: Option[S => Async[Unit]], release2: Option[T => Async[Unit]]): (Res[R] |*| Val[A]) -⚬ (Res[S] |*| Res[T] |*| Val[B])
def switch[A](using pos: SourcePos)(a: $[Val[A]])(using LambdaContext): ValSwitchInit[A]
def transformResource[R, A, S, B](f: (R, A) => (S, B), release: Option[S => Unit]): (Res[R] |*| Val[A]) -⚬ (Res[S] |*| Val[B])

Transforms a resource into a resource of (possibly) different type.

Transforms a resource into a resource of (possibly) different type.

Type parameters

A

additional parameter of the transformation

B

additional output of the transformation

R

type of the input resource

S

type of the output resource

Value parameters

f

the transformation function. It receives the input resource and additional input of type A. It returns the new resource and additional output of type B.

release

called to release the new resource in case of a crash. None means no cleanup is needed

Attributes

def transformResourceAsync[R, A, S, B](f: (R, A) => Async[(S, B)], release: Option[S => Async[Unit]]): (Res[R] |*| Val[A]) -⚬ (Res[S] |*| Val[B])
def tryAcquire[A, R, B, E](acquire: A => Either[E, (R, B)], release: Option[R => Unit]): Val[A] -⚬ (Val[E] |+| (Res[R] |*| Val[B]))

Acquires a resource of type R. Might fail with an error of type E.

Acquires a resource of type R. Might fail with an error of type E.

Type parameters

A

parameters of the acquire function

B

additional data produced by acquiring the resource

E

type of the error

R

type of the resource

Value parameters

release

called to release the resource in case of a crash. None means no cleanup is needed

Attributes

def trySplitResource[R, A, S, T, B, E](f: (R, A) => Either[E, (S, T, B)], release1: Option[S => Unit], release2: Option[T => Unit]): (Res[R] |*| Val[A]) -⚬ (Val[E] |+| (Res[S] |*| Res[T] |*| Val[B]))
def trySplitResourceAsync[R, A, S, T, B, E](f: (R, A) => Async[Either[E, (S, T, B)]], release1: Option[S => Async[Unit]], release2: Option[T => Async[Unit]]): (Res[R] |*| Val[A]) -⚬ (Val[E] |+| (Res[S] |*| Res[T] |*| Val[B]))
def tryTransformResource[R, A, S, B, E](f: (R, A) => Either[E, (S, B)], release: Option[S => Unit]): (Res[R] |*| Val[A]) -⚬ (Val[E] |+| (Res[S] |*| Val[B]))

Transforms a resource into a resource of (possibly) different type. Might fail with an error of type E.

Transforms a resource into a resource of (possibly) different type. Might fail with an error of type E.

Type parameters

A

additional parameter of the transformation

B

additional output of the transformation

E

type of the error

R

type of the input resource

S

type of the output resource

Value parameters

f

the transformation function. It receives the input resource and additional input of type A. It returns either an error of type E or the new resource and additional output of type B. In case the transformation results in an error, the original resource is ''not'' released automatically— the passing of the original resource R to the transformation function f indicates transfer of responsibility for the resource to the function f.

release

called to release the new resource in case of a crash. None means no cleanup is needed

Attributes

def tryTransformResourceAsync[R, A, S, B, E](f: (R, A) => Async[Either[E, (S, B)]], release: Option[S => Async[Unit]]): (Res[R] |*| Val[A]) -⚬ (Val[E] |+| (Res[S] |*| Val[B]))
def tuple[A, B](a: $[Val[A]], b: $[Val[B]])(using SourcePos, LambdaContext): $[Val[(A, B)]]
def tuple[A, B, C](a: $[Val[A]], b: $[Val[B]], c: $[Val[C]])(using SourcePos, LambdaContext): $[Val[(A, B, C)]]
def tuple[A, B, C, D](a: $[Val[A]], b: $[Val[B]], c: $[Val[C]], d: $[Val[D]])(using SourcePos, LambdaContext): $[Val[(A, B, C, D)]]
def tuple[A, B, C, D, E](a: $[Val[A]], b: $[Val[B]], c: $[Val[C]], d: $[Val[D]], e: $[Val[E]])(using SourcePos, LambdaContext): $[Val[(A, B, C, D, E)]]
def tuple[A, B, C, D, E, F](a: $[Val[A]], b: $[Val[B]], c: $[Val[C]], d: $[Val[D]], e: $[Val[E]], f: $[Val[F]])(using SourcePos, LambdaContext): $[Val[(A, B, C, D, E, F)]]
def unliftEither[A, B]: (Val[A] |+| Val[B]) -⚬ Val[Either[A, B]]
def unliftNegPair[A, B]: (Neg[A] |*| Neg[B]) -⚬ Neg[(A, B)]

Inherited methods

def InL[A, B]: Extractor[-⚬, |*|, A |+| B, A]

Attributes

Inherited from:
Puro
def InR[A, B]: Extractor[-⚬, |*|, A |+| B, B]

Attributes

Inherited from:
Puro
def chooseROnPong[A, B]: (A |&| B) -⚬ (Pong |*| B)

Attributes

Inherited from:
Puro
def coDistributeR[A, B, C]: ((A |*| C) |&| (B |*| C)) -⚬ ((A |&| B) |*| C)

Inverse of coFactorR.

Inverse of coFactorR.

Attributes

Inherited from:
Puro
def coFactorL[A, B, C]: (A |*| (B |&| C)) -⚬ ((A |*| B) |&| (A |*| C))

Attributes

Inherited from:
Puro
def coFactorR[A, B, C]: ((A |&| B) |*| C) -⚬ ((A |*| C) |&| (B |*| C))

Attributes

Inherited from:
Puro
def constant[A](f: One -⚬ A)(using SourcePos, LambdaContext): $[A]

Attributes

Inherited from:
Puro
def contrapositive[A, B](f: A -⚬ B): -[B] -⚬ -[A]

Attributes

Inherited from:
Puro
def crashNow[A, B](msg: String): A -⚬ B

Attributes

Inherited from:
CrashDSL
def crashWhenNeed[A, B](msg: String): A -⚬ (Need |*| B)

Attributes

Inherited from:
CrashDSL
def crashd(msg: String): Done -⚬ Done

Attributes

Inherited from:
CrashDSL
def crashn(msg: String): Need -⚬ Need

Attributes

Inherited from:
CrashDSL
def curry[A, B, C](f: (A |*| B) -⚬ C): A -⚬ (B =⚬ C)

Attributes

Inherited from:
Puro
def delayNeed(d: FiniteDuration): Need -⚬ Need

Attributes

Inherited from:
TimerDSL
def demand[A]: One -⚬ (-[A] |*| A)

Creates a demand on the first out-port, channeling the provided resource to the second out-port. Alias for forevert.

Creates a demand on the first out-port, channeling the provided resource to the second out-port. Alias for forevert.

Attributes

Inherited from:
Puro
def demandChoice[A, B]: (-[A] |+| -[B]) -⚬ -[A |&| B]

Converts an obligation to handle either demand to an obligation to supply a choice. Alias for factorInversionOutOf_|+|.

Converts an obligation to handle either demand to an obligation to supply a choice. Alias for factorInversionOutOf_|+|.

Attributes

Inherited from:
Puro
def demandChosen[A, B]: -[A |&| B] -⚬ (-[A] |+| -[B])

Converts a demand for choice to a demand of the chosen side. Alias for distributeInversionInto_|&amp;|.

Converts a demand for choice to a demand of the chosen side. Alias for distributeInversionInto_|&amp;|.

Attributes

Inherited from:
Puro
def demandEither[A, B]: (-[A] |&| -[B]) -⚬ -[A |+| B]

Converts choice of demands to demand of either. Alias for factorInversionOutOf_|&amp;|.

Converts choice of demands to demand of either. Alias for factorInversionOutOf_|&amp;|.

Attributes

Inherited from:
Puro
def demandSeparately[A, B]: -[A |*| B] -⚬ (-[A] |*| -[B])

Attributes

Inherited from:
Puro
def demandTogether[A, B]: (-[A] |*| -[B]) -⚬ -[A |*| B]

Alias for factorOutInversion.

Alias for factorOutInversion.

Attributes

Inherited from:
Puro
def die[A]: -[-[A]] -⚬ A

Double-inversion elimination.

Double-inversion elimination.

Attributes

Inherited from:
Puro
def dii[A]: A -⚬ -[-[A]]

Double-inversion introduction.

Double-inversion introduction.

Attributes

Inherited from:
Puro

Attributes

Inherited from:
Puro

Attributes

Inherited from:
Puro
def distributeInversionInto_|&|[A, B]: -[A |&| B] -⚬ (-[A] |+| -[B])

Attributes

Inherited from:
Puro
def distributeInversionInto_|+|[A, B]: -[A |+| B] -⚬ (-[A] |&| -[B])

Attributes

Inherited from:
Puro
def distributeR[A, B, C]: ((A |+| B) |*| C) -⚬ ((A |*| C) |+| (B |*| C))

Distribute the factor on the right into the summands on the left. Inverse of factorR.

Distribute the factor on the right into the summands on the left. Inverse of factorR.

Attributes

Inherited from:
Puro
def done: One -⚬ Done

Attributes

Inherited from:
Puro

Attributes

Inherited from:
Puro

Alias for die.

Alias for die.

Attributes

Inherited from:
Puro

Alias for dii.

Alias for dii.

Attributes

Inherited from:
Puro
def elimFst[A, B](f: A -⚬ One): (A |*| B) -⚬ B

Attributes

Inherited from:
Puro
def elimSnd[A, B](f: B -⚬ One): (A |*| B) -⚬ A

Attributes

Inherited from:
Puro
def eval[A, B]: ((A =⚬ B) |*| A) -⚬ B

Attributes

Inherited from:
Puro
def factorInversionOutOf_|&|[A, B]: (-[A] |&| -[B]) -⚬ -[A |+| B]

Attributes

Inherited from:
Puro
def factorInversionOutOf_|+|[A, B]: (-[A] |+| -[B]) -⚬ -[A |&| B]

Attributes

Inherited from:
Puro
def factorL[A, B, C]: ((A |*| B) |+| (A |*| C)) -⚬ (A |*| (B |+| C))

Factor out the factor A on the left of both summands.

Factor out the factor A on the left of both summands.

Attributes

Inherited from:
Puro
def factorR[A, B, C]: ((A |*| C) |+| (B |*| C)) -⚬ ((A |+| B) |*| C)

Factor out the factor C on the right of both summands.

Factor out the factor C on the right of both summands.

Attributes

Inherited from:
Puro
def forkMap[A, B](f: Done -⚬ A, g: Done -⚬ B): Done -⚬ (A |*| B)

Attributes

Inherited from:
Puro
def forkMapNeed[A, B](f: A -⚬ Need, g: B -⚬ Need): (A |*| B) -⚬ Need

Attributes

Inherited from:
Puro
def fst[A, B, C](f: A -⚬ B): (A |*| C) -⚬ (B |*| C)

Attributes

Inherited from:
Puro
def fun[A, B]: Sub[A, B] -⚬ (A =⚬ B)

Attributes

Inherited from:
Puro
def injectROnPing[A, B]: (Ping |*| B) -⚬ (A |+| B)

Attributes

Inherited from:
Puro
def introFst[A, X](f: One -⚬ X): A -⚬ (X |*| A)

Attributes

Inherited from:
Puro
def introSnd[A, X](f: One -⚬ X): A -⚬ (A |*| X)

Attributes

Inherited from:
Puro
def invertClosure[A, B]: -[A =⚬ B] -⚬ (B =⚬ A)

Attributes

Inherited from:
Puro

Attributes

Inherited from:
Puro

Attributes

Inherited from:
Puro

Attributes

Inherited from:
Puro

Attributes

Inherited from:
Puro

Attributes

Inherited from:
Puro
def joinAll(a: $[Done], as: $[Done]*)(using pos: SourcePos, ctx: LambdaContext): $[Done]

Attributes

Inherited from:
Puro
def joinMap[A, B](f: A -⚬ Done, g: B -⚬ Done): (A |*| B) -⚬ Done

Attributes

Inherited from:
Puro
def joinMapNeed[A, B](f: Need -⚬ A, g: Need -⚬ B): Need -⚬ (A |*| B)

Attributes

Inherited from:
Puro
def need: Need -⚬ One

Attributes

Inherited from:
Puro

Attributes

Inherited from:
Puro

Attributes

Inherited from:
Puro

Attributes

Inherited from:
Puro
def obj[A, B](f: A -⚬ B): One -⚬ (A =⚬ B)

Turn a function into a function object.

Turn a function into a function object.

Attributes

Inherited from:
Puro
def out[A, B, C](f: B -⚬ C): (A =⚬ B) -⚬ (A =⚬ C)

Map the output of a function object.

Map the output of a function object.

Attributes

Inherited from:
Puro
def packDemand[F[_]]: -[F[Rec[F]]] -⚬ -[Rec[F]]

Attributes

Inherited from:
Puro

Attributes

Inherited from:
Puro

Attributes

Inherited from:
Puro
def returning[A](a: ??[A], as: ??[One]*)(using pos: SourcePos, ctx: LambdaContext): ??[A]

Attributes

Inherited from:
Puro
def returning[A](a: $[A], as: $[One]*)(using pos: SourcePos, ctx: LambdaContext): $[A]

Attributes

Inherited from:
Puro
def snd[A, B, C](f: B -⚬ C): (A |*| B) -⚬ (A |*| C)

Attributes

Inherited from:
Puro
def subroutine[A, B](f: A -⚬ B)(using SourcePos, LambdaContext): $[Sub[A, B]]

Attributes

Inherited from:
Puro
def supply[A]: (A |*| -[A]) -⚬ One

Uses the resource from the first in-port to satisfy the demand from the second in-port. Alias for backvert.

Uses the resource from the first in-port to satisfy the demand from the second in-port. Alias for backvert.

Attributes

Inherited from:
Puro
def switch[A](using ctx: LambdaContext, pos: SourcePos)(a: $[A]): SwitchInit[A]

Attributes

Inherited from:
Puro
def toChoiceOfDemands[A, B]: -[A |+| B] -⚬ (-[A] |&| -[B])

Converts demand for either to a choice of which side to supply. Alias for distributeInversionInto_|+|.

Converts demand for either to a choice of which side to supply. Alias for distributeInversionInto_|+|.

Attributes

Inherited from:
Puro
def unContrapositive[A, B](f: -[A] -⚬ -[B]): B -⚬ A

Attributes

Inherited from:
Puro
def unInvertClosure[A, B]: (A =⚬ B) -⚬ -[B =⚬ A]

Attributes

Inherited from:
Puro

Attributes

Inherited from:
Puro
def uncurry[A, B, C](f: A -⚬ (B =⚬ C)): (A |*| B) -⚬ C

Attributes

Inherited from:
Puro
def unpackDemand[F[_]]: -[Rec[F]] -⚬ -[F[Rec[F]]]

Attributes

Inherited from:
Puro

Inherited and Abstract methods

def absurd[A]: Void -⚬ A

Attributes

Inherited from:
Puro
def andThen[A, B, C](f: A -⚬ B, g: B -⚬ C): A -⚬ C

Attributes

Inherited from:
Puro
def assocLR[A, B, C]: (A |*| B |*| C) -⚬ (A |*| (B |*| C))

Attributes

Inherited from:
Puro
def assocRL[A, B, C]: (A |*| (B |*| C)) -⚬ (A |*| B |*| C)

Attributes

Inherited from:
Puro
def backvert[A]: (A |*| -[A]) -⚬ One
 ┏━━━━━━━━━━━┓
 ┞────┐      ┃
 ╎  A │┄┄┐   ┃
 ┟────┘  ┆   ┃
 ┃       ┆   ┃
 ┞────┐  ┆   ┃
 ╎-[A]│←┄┘   ┃
 ┟────┘      ┃
 ┗━━━━━━━━━━━┛

Attributes

Inherited from:
Puro
def choice[A, B, C](caseLeft: A -⚬ B, caseRight: A -⚬ C): A -⚬ (B |&| C)

Attributes

Inherited from:
Puro
def chooseL[A, B]: (A |&| B) -⚬ A

Attributes

Inherited from:
Puro
def chooseLOnPong[A, B]: (A |&| B) -⚬ (Pong |*| A)

Attributes

Inherited from:
Puro
def chooseR[A, B]: (A |&| B) -⚬ B

Attributes

Inherited from:
Puro
def coDistributeL[A, B, C]: ((A |*| B) |&| (A |*| C)) -⚬ (A |*| (B |&| C))

Inverse of coFactorL.

Inverse of coFactorL.

Attributes

Inherited from:
Puro
def crashWhenDone[A, B](msg: String): (Done |*| A) -⚬ B

Starts propagating an error downstream (which might be through both the in-port and the out-port).

Starts propagating an error downstream (which might be through both the in-port and the out-port).

Use only for irrecoverable errors. Recoverable errors should be expressed in function signature and handled appropriately.

Done on the in-port is the trigger to crash. A on the in-port allows to consume any unhandled resources. B on the out-port allows to fulfill any obligation to produce resources.

Attributes

Inherited from:
CrashDSL

Attributes

Inherited from:
Puro
def distributeInversion[A, B]: -[A |*| B] -⚬ (-[A] |*| -[B])
 ┏━━━━━━━━━━━┓
 ┃           ┞────┐
 ┞────┐      ╎-[A]│
 ╎ ⎡A⎤│      ┟────┘
 ╎-⎢⊗⎥│      ┃
 ╎ ⎣B⎦│      ┞────┐
 ┟────┘      ╎-[B]│
 ┃           ┟────┘
 ┗━━━━━━━━━━━┛

Attributes

Inherited from:
Puro
def distributeL[A, B, C]: (A |*| (B |+| C)) -⚬ ((A |*| B) |+| (A |*| C))

Distribute the factor on the left into the summands on the right. Inverse of factorL.

Distribute the factor on the left into the summands on the right. Inverse of factorL.

Attributes

Inherited from:
Puro
def either[A, B, C](caseLeft: A -⚬ C, caseRight: B -⚬ C): (A |+| B) -⚬ C

Attributes

Inherited from:
Puro
def elimFst[B]: (One |*| B) -⚬ B

Attributes

Inherited from:
Puro
def elimSnd[A]: (A |*| One) -⚬ A

Attributes

Inherited from:
Puro
def factorOutInversion[A, B]: (-[A] |*| -[B]) -⚬ -[A |*| B]
 ┏━━━━━━━━━━━┓
 ┞────┐      ┃
 ╎-[A]│      ┞────┐
 ┟────┘      ╎ ⎡A⎤│
 ┃           ╎-⎢⊗⎥│
 ┞────┐      ╎ ⎣B⎦│
 ╎-[B]│      ┟────┘
 ┟────┘      ┃
 ┗━━━━━━━━━━━┛

Attributes

Inherited from:
Puro
def forevert[A]: One -⚬ (-[A] |*| A)
 ┏━━━━━━┓
 ┃      ┞────┐
 ┃   ┌┄┄╎-[A]│
 ┃   ┆  ┟────┘
 ┃   ┆  ┃
 ┃   ┆  ┞────┐
 ┃   └┄→╎  A │
 ┃      ┟────┘
 ┗━━━━━━┛

Attributes

Inherited from:
Puro

Attributes

Inherited from:
Puro

Attributes

Inherited from:
Puro

Attributes

Inherited from:
Puro

Attributes

Inherited from:
Puro
def id[A]: A -⚬ A

Attributes

Inherited from:
Puro
def injectL[A, B]: A -⚬ (A |+| B)

Attributes

Inherited from:
Puro
def injectLOnPing[A, B]: (Ping |*| A) -⚬ (A |+| B)

Attributes

Inherited from:
Puro
def injectR[A, B]: B -⚬ (A |+| B)

Attributes

Inherited from:
Puro
def introFst[B]: B -⚬ (One |*| B)

Attributes

Inherited from:
Puro
def introSnd[A]: A -⚬ (A |*| One)

Attributes

Inherited from:
Puro
def invoke[A, B]: (Sub[A, B] |*| A) -⚬ B

An invocation of a subroutine.

An invocation of a subroutine.

Attributes

Inherited from:
Puro

Attributes

Inherited from:
Puro

Attributes

Inherited from:
Puro

Attributes

Inherited from:
Puro

Attributes

Inherited from:
Puro

Attributes

Inherited from:
Puro

Attributes

Inherited from:
Puro

Attributes

Inherited from:
Puro

Reverses the Need signal (flowing in the negative direciton, i.e. against the -⚬ arrow) into a Done signal (flowing in the positive direction, i.e. along the -⚬ arrow).

Reverses the Need signal (flowing in the negative direciton, i.e. against the -⚬ arrow) into a Done signal (flowing in the positive direction, i.e. along the -⚬ arrow).

 ┏━━━━━━┓
 ┃      ┞────┐
 ┃   ┌┄┄╎Need│
 ┃   ┆  ┟────┘
 ┃   ┆  ┃
 ┃   ┆  ┞────┐
 ┃   └┄→╎Done│
 ┃      ┟────┘
 ┗━━━━━━┛

Attributes

Inherited from:
Puro

Attributes

Inherited from:
Puro
def notifyChoice[A, B]: (Pong |*| (A |&| B)) -⚬ (A |&| B)

Signals (in the negative direction) when it is known which side of the choice (A |&| B) has been chosen.

Signals (in the negative direction) when it is known which side of the choice (A |&| B) has been chosen.

Attributes

Inherited from:
Puro

Attributes

Inherited from:
Puro
def notifyEither[A, B]: (A |+| B) -⚬ (Ping |*| (A |+| B))

Signals when it is decided whether A |+| B actually contains the left side or the right side.

Signals when it is decided whether A |+| B actually contains the left side or the right side.

Attributes

Inherited from:
Puro

Attributes

Inherited from:
Puro
def pack[F[_]]: F[Rec[F]] -⚬ Rec[F]

Hides one level of a recursive type definition.

Hides one level of a recursive type definition.

Attributes

Inherited from:
Puro
def par[A, B, C, D](f: A -⚬ B, g: C -⚬ D): (A |*| C) -⚬ (B |*| D)

Attributes

Inherited from:
Puro
def ping: One -⚬ Ping

Attributes

Inherited from:
Puro
def pong: Pong -⚬ One

Attributes

Inherited from:
Puro

Attributes

Inherited from:
Puro

Reverses the Done signal (flowing in the positive direction, i.e. along the -⚬ arrow) into a Need signal (flowing in the negative direciton, i.e. against the -⚬ arrow).

Reverses the Done signal (flowing in the positive direction, i.e. along the -⚬ arrow) into a Need signal (flowing in the negative direciton, i.e. against the -⚬ arrow).

 ┏━━━━━━━━━━━┓
 ┞────┐      ┃
 ╎Done│┄┄┐   ┃
 ┟────┘  ┆   ┃
 ┃       ┆   ┃
 ┞────┐  ┆   ┃
 ╎Need│←┄┘   ┃
 ┟────┘      ┃
 ┗━━━━━━━━━━━┛

Attributes

Inherited from:
Puro

Attributes

Inherited from:
Puro

Races the two Ping signals. Produces left if the first signal wins and right if the second signal wins. It is biased to the left: if both signals have arrived by the time of inquiry, returns left.

Races the two Ping signals. Produces left if the first signal wins and right if the second signal wins. It is biased to the left: if both signals have arrived by the time of inquiry, returns left.

Attributes

Inherited from:
Puro
def rec[A, B](f: (Sub[A, B] |*| A) -⚬ B): A -⚬ B

Attributes

Inherited from:
Puro
def rec[A, B](using pos: SourcePos)(f: (A -⚬ B) => A -⚬ B): A -⚬ B

Attributes

Inherited from:
Puro
def recPartitioning[F[_]](p: Partitioning[-⚬, |*|, F[Rec[F]]]): Partitioning[-⚬, |*|, Rec[F]] { type Partition = p.Partition; }

Attributes

Inherited from:
Puro

Attributes

Inherited from:
Puro

Races the two Pong signals (traveling from right to left). Chooses left if the first signal wins and right if the second signal wins. It is biased to the left: if both signals have arrived by the time of inquiry, chooses left.

Races the two Pong signals (traveling from right to left). Chooses left if the first signal wins and right if the second signal wins. It is biased to the left: if both signals have arrived by the time of inquiry, chooses left.

Attributes

Inherited from:
Puro
def sharedCode[A, B](using SourcePos)(f: A -⚬ B): A -⚬ B

Attributes

Inherited from:
Puro

Attributes

Inherited from:
Puro

Attributes

Inherited from:
Puro
def sub[A, B](using pos: SourcePos)(f: A -⚬ B): One -⚬ Sub[A, B]

Attributes

Inherited from:
Puro
def swap[A, B]: (A |*| B) -⚬ (B |*| A)

Attributes

Inherited from:
Puro
protected def switch[A, R](using LambdaContext, SourcePos)(a: $[A])(cases: (SourcePos, LambdaContext ?=> $[A] => $[R])*): $[R]

Attributes

Inherited from:
Puro
def unpack[F[_]]: Rec[F] -⚬ F[Rec[F]]

Unpacks one level of a recursive type definition.

Unpacks one level of a recursive type definition.

Attributes

Inherited from:
Puro

Abstract fields

override val UInt31: UInt31Scaletto

Inherited fields

val Affine: Affine.type

Attributes

Inherited from:
Puro

Inherited and Abstract fields

val $: $Ops

Attributes

Inherited from:
Puro
val OneOf: EnumModule[-⚬, |*|, OneOf, ||, ::]

Attributes

Inherited from:
Puro
protected val SumPartitioning: CoproductPartitioning[-⚬, |*|, |+|]

Attributes

Inherited from:
Puro

Attributes

Inherited from:
Puro
val λ: LambdaOps

Attributes

Inherited from:
Puro

Givens

Inherited givens

given affineEither[A, B](using A: Affine[A], B: Affine[B]): Affine[A |+| B]

Attributes

Inherited from:
Puro
given affineOne: Affine[One]

Attributes

Inherited from:
Puro
given affinePair[A, B](using A: Affine[A], B: Affine[B]): Affine[A |*| B]

Attributes

Inherited from:
Puro

Attributes

Inherited from:
Puro

Attributes

Inherited from:
Puro

Attributes

Inherited from:
Puro

Attributes

Inherited from:
Puro

Attributes

Inherited from:
Puro

Attributes

Inherited from:
Puro

Attributes

Inherited from:
Puro

Attributes

Inherited from:
Puro

Inherited and Abstract givens

given category: ClosedSymmetricMonoidalCategory[-⚬, |*|, One, =⚬]

Attributes

Inherited from:
Puro
given comonoidSub[A, B]: Comonoid[Sub[A, B]]

A subroutine is available any number of times.

A subroutine is available any number of times.

Attributes

Inherited from:
Puro

Extensions

Extensions

extension [A, B](f: ScalaFun[A, B])
def adapt[Z, C](pre: Z => A, post: B => C): ScalaFun[Z, C]
def adaptPost[C](post: B => C): ScalaFun[A, C]
def adaptPre[Z](pre: Z => A): ScalaFun[Z, B]
def adaptWith[Z, P, C](pre: Z => (P, A), post: (P, B) => C): ScalaFun[Z, C]

Inherited extensions

extension [A](a: ??[-[A]])
def asInput(using pos: SourcePos, ctx: LambdaContext): $[A]

Attributes

Inherited from:
Puro
extension (d: $[Done])
infix def alsoJoin(others: $[Done]*)(using pos: SourcePos, ctx: LambdaContext): $[Done]

Attributes

Inherited from:
Puro
extension [B](expr: $[-[B]])
infix def contramap[A](f: A -⚬ B)(using pos: SourcePos, ctx: LambdaContext): $[-[A]]

Attributes

Inherited from:
Puro
infix def unInvertWith[A](lInvert: One -⚬ (A |*| B))(using pos: SourcePos, ctx: LambdaContext): $[A]

Attributes

Inherited from:
Puro
extension [B](expr: ??[B])
def :=(value: $[B])(using pos: SourcePos, ctx: LambdaContext): ??[One]

Attributes

Inherited from:
Puro
infix def alsoElim(that: ??[One])(using pos: SourcePos, ctx: LambdaContext): ??[B]

Attributes

Inherited from:
Puro
def asInput[A](lInvert: One -⚬ (B |*| A))(using pos: SourcePos, ctx: LambdaContext): $[A]

Attributes

Inherited from:
Puro
def asInputInv(using pos: SourcePos, ctx: LambdaContext): $[-[B]]

Attributes

Inherited from:
Puro
def |*|[C](that: ??[C])(using pos: SourcePos, ctx: LambdaContext): ??[B |*| C]

Attributes

Inherited from:
Puro
extension [A, B](ext: Extractor[-⚬, |*|, A, B])
def apply(): B -⚬ A

Attributes

Inherited from:
Puro
def apply(using pos: SourcePos, ctx: LambdaContext)(b: $[B]): $[A]

Attributes

Inherited from:
Puro
def unapply(using pos: SourcePos, ctx: LambdaContext)(a: $[A]): Some[$[B]]

Attributes

Inherited from:
Puro
extension [F[_], B](ext: Extractor[-⚬, |*|, F[Rec[F]], B])
def afterUnpack: Extractor[-⚬, |*|, Rec[F], B]

Attributes

Inherited from:
Puro
extension [A, B](f: A -⚬ B)
def >[C](g: B -⚬ C): A -⚬ C

Attributes

Inherited from:
Puro
def >|(expr: ??[B])(using SourcePos, LambdaContext): ??[A]

"Prepend" this function A -⚬ B to a demand ??[B], reducing it to a demand ??[A].

"Prepend" this function A -⚬ B to a demand ??[B], reducing it to a demand ??[A].

Attributes

Inherited from:
Puro
def apply(a: $[A])(using pos: SourcePos, ctx: LambdaContext): $[B]

Attributes

Inherited from:
Puro
extension [A, B](f: $[A =⚬ B])
def apply(a: $[A])(using pos: SourcePos, ctx: LambdaContext): $[B]

Attributes

Inherited from:
Puro
extension [A, B](f: $[Sub[A, B]])
def apply(using pos: SourcePos, ctx: LambdaContext)(a: $[A]): $[B]

Attributes

Inherited from:
Puro
extension [F[_], A](fa: $[F[A]])(using F: Functor[-⚬, F])
def map[B](using SourcePos, LambdaContext)(f: A -⚬ B): $[F[B]]

Attributes

Inherited from:
Puro
extension [A, B](x: $[-[A |&| B]])
def choose[C](f: LambdaContext ?=> Either[$[-[A]], $[-[B]]] => $[C])(using pos: SourcePos, ctx: LambdaContext): $[C]

Attributes

Inherited from:
Puro
extension [A, B](x: ??[A |&| B])
def choose[C](f: LambdaContext ?=> Either[??[A], ??[B]] => ??[C])(using pos: SourcePos, ctx: LambdaContext): ??[C]

Attributes

Inherited from:
Puro

Deprecated and Inherited extensions

extension [A](a: $[A])
def :>:(b: ??[A]): ??[One]

Attributes

Deprecated
true
Inherited from:
Puro
def =:(b: ??[A]): ??[One]

Attributes

Inherited from:
Puro
extension [A](a: $[A])
def :>>[B](f: A -⚬ B)(using pos: SourcePos, ctx: LambdaContext): $[B]

Alias for |&gt;

Alias for |&gt;

Attributes

Deprecated
true
Inherited from:
Puro
def also[B](f: One -⚬ B)(using pos: SourcePos, ctx: LambdaContext): $[A |*| B]

Attributes

Inherited from:
Puro
infix def alsoElim(unit: $[One])(using pos: SourcePos, ctx: LambdaContext): $[A]

Attributes

Inherited from:
Puro
def alsoElimInv(x: $[-[One]])(using pos: SourcePos, ctx: LambdaContext): $[A]

Attributes

Inherited from:
Puro
def alsoFst[X](f: One -⚬ X)(using pos: SourcePos, ctx: LambdaContext): $[X |*| A]

Attributes

Inherited from:
Puro
def asOutput[B](rInvert: (A |*| B) -⚬ One)(using pos: SourcePos, ctx: LambdaContext): ??[B]

Attributes

Inherited from:
Puro
infix def supplyTo(out: $[-[A]])(using pos: SourcePos, ctx: LambdaContext): $[One]

Attributes

Inherited from:
Puro
def |*|[B](b: $[B])(using pos: SourcePos, ctx: LambdaContext): $[A |*| B]

Attributes

Inherited from:
Puro
def |>[B](f: A -⚬ B)(using pos: SourcePos, ctx: LambdaContext): $[B]

Pipeline operator: pass this expression into the given function.

Pipeline operator: pass this expression into the given function.

Attributes

Inherited from:
Puro
extension [A, B](f: A -⚬ B)
def >>:(expr: ??[B]): ??[A]

Reduce the demand for B to a demand for A by the function A -⚬ B.

Reduce the demand for B to a demand for A by the function A -⚬ B.

Attributes

Deprecated
true
Inherited from:
Puro
extension [A, B](x: $[A |+| B])
infix def either[C](f: LambdaContext ?=> Either[$[A], $[B]] => $[C])(using pos: SourcePos, ctx: LambdaContext): $[C]

Attributes

Deprecated
true
Inherited from:
Puro