ScalettoLib

libretto.scaletto.ScalettoLib
See theScalettoLib companion object
opaque class ScalettoLib[DSL <: Scaletto, PuroLib <: PuroLib[DSL]](val dsl: DSL, val puroLib: PuroLib & PuroLib[dsl.type])

Attributes

Companion
object
Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Type members

Classlikes

object **

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
**.type
object RefCounted

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
RefCounted.type
object Val

Attributes

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

Types

opaque type RefCounted[R]

Value members

Concrete methods

def acquire0[A, R](acquire: A => R, release: Option[R => Unit]): dsl.Val[A] dsl.-⚬ dsl.Res[R]

Variant of acquire that does not produce extra output in addition to the resource.

Variant of acquire that does not produce extra output in addition to the resource.

Attributes

def acquireAsync0[A, R](acquire: A => Async[R], release: Option[R => Async[Unit]]): dsl.Val[A] dsl.-⚬ dsl.Res[R]

Variant of acquireAsync that does not produce extra output in addition to the resource.

Variant of acquireAsync that does not produce extra output in addition to the resource.

Attributes

def alsoPrintLine: dsl.Val[String] dsl.-⚬ dsl.Val[String]
def alsoPrintLine[A](f: A => String): dsl.Val[A] dsl.-⚬ dsl.Val[A]
def alsoPrintLine[A](s: String)(using S: Positive[A], J: Positive[A]): A dsl.-⚬ A
def const[A](a: A): dsl.One dsl.-⚬ dsl.Val[A]
def constList[A](as: List[A]): dsl.One dsl.-⚬ puroLib.LList[dsl.Val[A]]
def constList1[A](a: A, as: List[A]): dsl.Done dsl.-⚬ puroLib.LList1[dsl.Val[A]]
def constList1[A](as: ::[A]): dsl.Done dsl.-⚬ puroLib.LList1[dsl.Val[A]]
def constList1Of[A](a: A, as: A*): dsl.Done dsl.-⚬ puroLib.LList1[dsl.Val[A]]
def constListOf[A](as: A*): dsl.One dsl.-⚬ puroLib.LList[dsl.Val[A]]
def constListOf1[A](a: A, as: A*): dsl.Done dsl.-⚬ puroLib.LList[dsl.Val[A]]
def decrement: dsl.Val[Int] dsl.-⚬ (dsl.Done dsl.|+| dsl.Val[Int])
def delayRandomMs(minMs: Int, maxMs: Int): dsl.Done dsl.-⚬ dsl.Done
def delayVal[A](by: dsl.Done dsl.-⚬ dsl.Done): dsl.Val[A] dsl.-⚬ dsl.Val[A]
def delayVal[A](by: FiniteDuration): dsl.Val[A] dsl.-⚬ dsl.Val[A]
def delayValRandomMs[A](minMs: Int, maxMs: Int): dsl.Val[A] dsl.-⚬ dsl.Val[A]
def effect0[R](f: R => Unit): dsl.Res[R] dsl.-⚬ dsl.Res[R]

Variant of effect that does not take additional input and does not produce additional output.

Variant of effect that does not take additional input and does not produce additional output.

Attributes

def effectAsync0[R](f: R => Async[Unit]): dsl.Res[R] dsl.-⚬ dsl.Res[R]

Variant of effectAsync that does not take additional input and does not produce additional output.

Variant of effectAsync that does not take additional input and does not produce additional output.

Attributes

def effectRd[R, B](f: dsl.ScalaFun[R, B]): dsl.Res[R] dsl.-⚬ (dsl.Res[R] dsl.|*| dsl.Val[B])
def effectRd[R, B](f: R => B): dsl.Res[R] dsl.-⚬ (dsl.Res[R] dsl.|*| dsl.Val[B])
def equivBy[A, B, K](aKey: puroLib.Getter[A, dsl.Val[K]], bKey: puroLib.Getter[B, dsl.Val[K]])(using ord: Ordering[K]): (A dsl.|*| B) dsl.-⚬ ((A dsl.|*| B) dsl.|+| (A dsl.|*| B))
def gtBy[A, B, K](aKey: puroLib.Getter[A, dsl.Val[K]], bKey: puroLib.Getter[B, dsl.Val[K]])(using ord: Ordering[K]): (A dsl.|*| B) dsl.-⚬ ((A dsl.|*| B) dsl.|+| (A dsl.|*| B))
def gteqBy[A, B, K](aKey: puroLib.Getter[A, dsl.Val[K]], bKey: puroLib.Getter[B, dsl.Val[K]])(using ord: Ordering[K]): (A dsl.|*| B) dsl.-⚬ ((A dsl.|*| B) dsl.|+| (A dsl.|*| B))
def isEq[A](using ord: Ordering[A]): (dsl.Val[A] dsl.|*| dsl.Val[A]) dsl.-⚬ puroLib.Bool
def isGt[A](using ord: Ordering[A]): (dsl.Val[A] dsl.|*| dsl.Val[A]) dsl.-⚬ puroLib.Bool
def isGteq[A](using ord: Ordering[A]): (dsl.Val[A] dsl.|*| dsl.Val[A]) dsl.-⚬ puroLib.Bool
def isLt[A](using ord: Ordering[A]): (dsl.Val[A] dsl.|*| dsl.Val[A]) dsl.-⚬ puroLib.Bool
def isLteq[A](using ord: Ordering[A]): (dsl.Val[A] dsl.|*| dsl.Val[A]) dsl.-⚬ puroLib.Bool
def latestValue[A]: (dsl.Val[A] dsl.|*| puroLib.LList[dsl.Val[A]]) dsl.-⚬ (puroLib.Endless[dsl.Val[A]] dsl.|*| dsl.Done)
def liftBipredicate[A, B](p: (A, B) => Boolean): (dsl.Val[A] dsl.|*| dsl.Val[B]) dsl.-⚬ puroLib.Bool
def liftBoolean: dsl.Val[Boolean] dsl.-⚬ puroLib.Bool
def liftScalaList1[A]: dsl.Val[::[A]] dsl.-⚬ puroLib.LList1[dsl.Val[A]]
def ltBy[A, B, K](aKey: puroLib.Getter[A, dsl.Val[K]], bKey: puroLib.Getter[B, dsl.Val[K]])(using ord: Ordering[K]): (A dsl.|*| B) dsl.-⚬ ((A dsl.|*| B) dsl.|+| (A dsl.|*| B))
def lteqBy[A, B, K](aKey: puroLib.Getter[A, dsl.Val[K]], bKey: puroLib.Getter[B, dsl.Val[K]])(using ord: Ordering[K]): (A dsl.|*| B) dsl.-⚬ ((A dsl.|*| B) dsl.|+| (A dsl.|*| B))
def mVal[A, R](init: A => R): dsl.Val[A] dsl.-⚬ dsl.Res[R]

Create a resource that is just a (potentially) mutable value which does not need any cleanup.

Create a resource that is just a (potentially) mutable value which does not need any cleanup.

Value parameters

init

function that initializes the (potentially) mutable value from an immutable one.

Attributes

def maybeToOption[A]: puroLib.Maybe[dsl.Val[A]] dsl.-⚬ dsl.Val[Option[A]]
def mergeDemands[A]: (dsl.Neg[A] dsl.|*| dsl.Neg[A]) dsl.-⚬ dsl.Neg[A]
def optionToPMaybe[A]: dsl.Val[Option[A]] dsl.-⚬ puroLib.PMaybe[dsl.Val[A]]
def pMaybeToOption[A]: puroLib.PMaybe[dsl.Val[A]] dsl.-⚬ dsl.Val[Option[A]]
def printLine: dsl.Val[String] dsl.-⚬ dsl.Done
def printLine(s: String): dsl.Done dsl.-⚬ dsl.Done
def printLine[A](f: A => String): dsl.Val[A] dsl.-⚬ dsl.Done
def putStr: dsl.Val[String] dsl.-⚬ dsl.Done
def putStr(s: String): dsl.Done dsl.-⚬ dsl.Done
def readLine: dsl.Done dsl.-⚬ dsl.Val[String]
def release0[R, B](release: R => B): dsl.Res[R] dsl.-⚬ dsl.Val[B]

Variant of release that does not take additional input.

Variant of release that does not take additional input.

Attributes

def releaseAsync0[R, B](release: R => Async[B]): dsl.Res[R] dsl.-⚬ dsl.Val[B]

Variant of releaseAsync that does not take additional input.

Variant of releaseAsync that does not take additional input.

Attributes

def sortBy[A, B, K : Ordering](aKey: puroLib.Getter[A, dsl.Val[K]], bKey: puroLib.Getter[B, dsl.Val[K]]): (A dsl.|*| B) dsl.-⚬ ((A dsl.|*| B) dsl.|+| (B dsl.|*| A))
def splitResource0[R, S, T](f: dsl.ScalaFun[R, (S, T)], release1: Option[dsl.ScalaFun[S, Unit]], release2: Option[dsl.ScalaFun[T, Unit]]): dsl.Res[R] dsl.-⚬ (dsl.Res[S] dsl.|*| dsl.Res[T])
def splitResource0[R, S, T](f: R => (S, T), release1: Option[S => Unit], release2: Option[T => Unit]): dsl.Res[R] dsl.-⚬ (dsl.Res[S] dsl.|*| dsl.Res[T])
def splitResourceAsync0[R, S, T](f: R => Async[(S, T)], release1: Option[S => Async[Unit]], release2: Option[T => Async[Unit]]): dsl.Res[R] dsl.-⚬ (dsl.Res[S] dsl.|*| dsl.Res[T])
def testByVals[A, B, K](aKey: puroLib.Getter[A, dsl.Val[K]], bKey: puroLib.Getter[B, dsl.Val[K]], pred: (K, K) => Boolean): (A dsl.|*| B) dsl.-⚬ ((A dsl.|*| B) dsl.|+| (A dsl.|*| B))
def toScalaList[A]: puroLib.LList[dsl.Val[A]] dsl.-⚬ dsl.Val[List[A]]
def toScalaList1[A]: puroLib.LList1[dsl.Val[A]] dsl.-⚬ dsl.Val[::[A]]
def transformResource0[R, S](f: R => S, release: Option[S => Unit]): dsl.Res[R] dsl.-⚬ dsl.Res[S]

Variant of transformResource that does not take additional input and does not produce additional output.

Variant of transformResource that does not take additional input and does not produce additional output.

Attributes

def transformResourceAsync0[R, S](f: R => Async[S], release: Option[S => Async[Unit]]): dsl.Res[R] dsl.-⚬ dsl.Res[S]

Variant of transformResourceAsync that does not take additional input and does not produce additional output.

Variant of transformResourceAsync that does not take additional input and does not produce additional output.

Attributes

def tryEffectAcquireWr[R, A, S, E](f: dsl.ScalaFun[(R, A), Either[E, S]], release: Option[dsl.ScalaFun[S, Unit]]): (dsl.Res[R] dsl.|*| dsl.Val[A]) dsl.-⚬ (dsl.Res[R] dsl.|*| (dsl.Val[E] dsl.|+| dsl.Res[S]))
def unliftBoolean: puroLib.Bool dsl.-⚬ dsl.Val[Boolean]

Concrete fields

val dsl: DSL
val puroLib: PuroLib & PuroLib[dsl.type]

Givens

Givens

given closeableCosemigroupVal[A]: closeableCosemigroupVal[A]
given given_Comparable_Val_Val[A : Ordering]: given_Comparable_Val_Val[A]
given given_NMonoid_Neg[A]: given_NMonoid_Neg[A]
given junctionNeg[A]: junctionNeg[A]
given junctionVal[A]: Positive[dsl.Val[A]]
given negValDuality[A]: puroLib.Dual[dsl.Neg[A], dsl.Val[A]]
given signalingNeg[A]: signalingNeg[A]
given signalingVal[A]: Positive[dsl.Val[A]]
given valNegDuality[A]: valNegDuality[A]

Extensions

Extensions

extension [A](a: dsl.$[dsl.Val[A]])(using dsl.LambdaContext)
def **[B](b: dsl.$[dsl.Val[B]])(using SourcePos): dsl.$[dsl.Val[(A, B)]]
extension [R](r: dsl.$[dsl.Res[R]])(using dsl.LambdaContext)
infix def releaseOnPing(p: dsl.$[dsl.Ping])(using SourcePos): dsl.$[dsl.Done]
infix def releaseWhen(d: dsl.$[dsl.Done])(using SourcePos): dsl.$[dsl.Done]