Scaletto
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
- Known subtypes
-
object FreeScaletto
Members list
Type members
Classlikes
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
- Known subtypes
-
object ScalaFun
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 Objecttrait Matchableclass Any
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
Inherited classlikes
Attributes
- Inherited from:
- Puro
- Supertypes
-
class Objecttrait Matchableclass Any
Attributes
- Inherited from:
- Puro
- Supertypes
- Known subtypes
Attributes
- Inherited from:
- Puro
- Supertypes
-
class Objecttrait Matchableclass Any
Attributes
- Inherited from:
- Puro
- Supertypes
- Known subtypes
-
trait Comonoid[A]object comonoidNeedobject comonoidOneobject comonoidPingobject comonoidPongobject cosemigroupDoneobject cosemigroupNeedobject cosemigroupPingobject cosemigroupPongtrait CloseableCosemigroup[A]object closeableCosemigroupDonetrait NComonoid[A]Show all
Attributes
- Inherited from:
- Puro
- Supertypes
-
class Objecttrait Matchableclass Any
Attributes
- Inherited from:
- Puro
- Supertypes
-
class Objecttrait Matchableclass Any
Attributes
- Inherited from:
- Puro
- Supertypes
-
class Objecttrait Matchableclass Any
- Known subtypes
-
trait UInt31Scalettoobject UInt31
Attributes
- Inherited from:
- Puro
- Supertypes
Attributes
- Inherited from:
- Puro
- Supertypes
Attributes
- Inherited from:
- Puro
- Supertypes
Attributes
- Inherited from:
- Puro
- Supertypes
Types
Demand for a Scala value of type A
.
Demand for a Scala value of type A
.
Somewhat analogous to scala.concurrent.Promise
Attributes
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
Scala value of type A
.
Scala value of type A
.
Somewhat analogous to scala.concurrent.Future.
Attributes
Inherited types
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
Inherited and Abstract types
-[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
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
Used to describe named fields: "label" :: Type
.
Attributes
- Inherited from:
- Puro
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
Attributes
- Inherited from:
- Puro
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
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
Used to define recursive types.
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
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
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
Concurrent pair. Also called a ''tensor product'' or simply ''times''.
Concurrent pair. Also called a ''tensor product'' or simply ''times''.
Attributes
- Inherited from:
- Puro
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
Value members
Abstract methods
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
Releases a resource using the release
function registered during resource acquisition.
Releases a resource using the release
function registered during resource acquisition.
Attributes
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
Concrete methods
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
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
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
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
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
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
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
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 functionf
indicates transfer of responsibility for the resource to the functionf
. - release
-
called to release the new resource in case of a crash.
None
means no cleanup is needed
Attributes
Inherited methods
Attributes
- Inherited from:
- Puro
Attributes
- Inherited from:
- Puro
Attributes
- Inherited from:
- CrashDSL
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
Converts a demand for choice to a demand of the chosen side. Alias for distributeInversionInto_|&|.
Converts a demand for choice to a demand of the chosen side. Alias for distributeInversionInto_|&|.
Attributes
- Inherited from:
- Puro
Converts choice of demands to demand of either. Alias for factorInversionOutOf_|&|.
Converts choice of demands to demand of either. Alias for factorInversionOutOf_|&|.
Attributes
- Inherited from:
- Puro
Alias for distributeInversion
Alias for factorOutInversion.
Double-inversion elimination.
Double-inversion introduction.
Attributes
- Inherited from:
- Puro
Attributes
- Inherited from:
- Puro
Attributes
- Inherited from:
- Puro
Attributes
- Inherited from:
- Puro
Factor out the factor A
on the left of both summands.
Factor out the factor C
on the right of both summands.
Attributes
- Inherited from:
- Puro
Attributes
- Inherited from:
- Puro
Attributes
- Inherited from:
- Puro
Turn a function into a function object.
Map the output of a function object.
Attributes
- Inherited from:
- Puro
Attributes
- Inherited from:
- Puro
Attributes
- Inherited from:
- Puro
Attributes
- Inherited from:
- Puro
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
Inherited and Abstract methods
┏━━━━━━━━━━━┓
┞────┐ ┃
╎ A │┄┄┐ ┃
┟────┘ ┆ ┃
┃ ┆ ┃
┞────┐ ┆ ┃
╎-[A]│←┄┘ ┃
┟────┘ ┃
┗━━━━━━━━━━━┛
Attributes
- Inherited from:
- Puro
Attributes
- Inherited from:
- Puro
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
┏━━━━━━━━━━━┓
┃ ┞────┐
┞────┐ ╎-[A]│
╎ ⎡A⎤│ ┟────┘
╎-⎢⊗⎥│ ┃
╎ ⎣B⎦│ ┞────┐
┟────┘ ╎-[B]│
┃ ┟────┘
┗━━━━━━━━━━━┛
Attributes
- Inherited from:
- Puro
Attributes
- Inherited from:
- Puro
┏━━━━━━━━━━━┓
┞────┐ ┃
╎-[A]│ ┞────┐
┟────┘ ╎ ⎡A⎤│
┃ ╎-⎢⊗⎥│
┞────┐ ╎ ⎣B⎦│
╎-[B]│ ┟────┘
┟────┘ ┃
┗━━━━━━━━━━━┛
Attributes
- Inherited from:
- Puro
┏━━━━━━┓
┃ ┞────┐
┃ ┌┄┄╎-[A]│
┃ ┆ ┟────┘
┃ ┆ ┃
┃ ┆ ┞────┐
┃ └┄→╎ A │
┃ ┟────┘
┗━━━━━━┛
Attributes
- Inherited from:
- Puro
An invocation of a subroutine.
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
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
Hides one level of a recursive type definition.
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
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.
Attributes
- Inherited from:
- Puro
Attributes
- Inherited from:
- Puro
Attributes
- Inherited from:
- Puro
Attributes
- Inherited from:
- Puro
Givens
Inherited givens
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
Attributes
- Inherited from:
- Puro
Extensions
Inherited extensions
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
"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
Attributes
- Inherited from:
- Puro
Attributes
- Inherited from:
- Puro
Attributes
- Inherited from:
- Puro
Deprecated and Inherited extensions
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
Pipeline operator: pass this expression into the given function.
Attributes
- Deprecated
- true
- Inherited from:
- Puro