FreeScalaDSL

object FreeScalaDSL extends ScalaDSL
trait ScalaDSL
trait CrashDSL
trait TimerDSL
trait CoreDSL
class Object
trait Matchable
class Any

Type members

Classlikes

sealed override trait -⚬[A, B]
Companion
object
object -⚬
Companion
class
final override class Done
final override class LTerminus
final override class Need
final override class Neg[A]
final override class One
final override class RTerminus
final override class Rec[F[_]]
final override class Res[A]
final override class Val[A]
final override class |&|[A, B]
final override class |*|[A, B]
final override class |+|[A, B]

Inherited types

type Zero

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

Inherited from
CoreDSL
type [A, B] = A |+| B

Alias for |+|.

Inherited from
CoreDSL
type [A, B] = A |*| B

Alias for |*|.

Inherited from
CoreDSL

Value members

Methods

override def acquire[A, R, B](acquire: A => (R, B), release: Option[R => Unit]): Val[A] -⚬ Res[R] |*| Val[B]
Definition Classes
override def andThen[A, B, C](f: A -⚬ B, g: B -⚬ C): A -⚬ C
Definition Classes
override def assocLR[A, B, C]: A |*| B |*| C -⚬ A |*| B |*| C
Definition Classes
override def assocRL[A, B, C]: A |*| B |*| C -⚬ A |*| B |*| C
Definition Classes
override def blocking[A, B](f: A => B): Val[A] -⚬ Val[B]
Definition Classes
override def choice[A, B, C](f: A -⚬ B, g: A -⚬ C): A -⚬ B |&| C
Definition Classes
override def chooseL[A, B]: A |&| B -⚬ A
Definition Classes
override def chooseLWhenNeed[A, B]: Need |*| A |&| B -⚬ Need |*| A
Definition Classes
override def chooseR[A, B]: A |&| B -⚬ B
Definition Classes
override def chooseRWhenNeed[A, B]: A |&| Need |*| B -⚬ Need |*| B
Definition Classes
override def coDistributeL[A, B, C]: A |*| B |&| A |*| C -⚬ A |*| B |&| C
Definition Classes
override def constNeg[A](a: A): Neg[A] -⚬ Need
Definition Classes
override def constVal[A](a: A): Done -⚬ Val[A]
Definition Classes
override def contramapNeg[A, B](f: A => B): Neg[B] -⚬ Neg[A]
Definition Classes
override def crash[A, B](msg: String): Done |*| A -⚬ Done |*| B
Definition Classes
override def delay: Val[FiniteDuration] -⚬ Done
Definition Classes
Definition Classes
override def distributeL[A, B, C]: A |*| B |+| C -⚬ A |*| B |+| A |*| C
Definition Classes
override def done: One -⚬ Done
Definition Classes
override def effectAsync[R, A, B](f: (R, A) => Async[B]): Res[R] |*| Val[A] -⚬ Res[R] |*| Val[B]
Definition Classes
override def effectWrAsync[R, A](f: (R, A) => Async[Unit]): Res[R] |*| Val[A] -⚬ Res[R]
Definition Classes
override def either[A, B, C](f: A -⚬ C, g: B -⚬ C): A |+| B -⚬ C
Definition Classes
override def elimFst[B]: One |*| B -⚬ B
Definition Classes
override def elimSnd[A]: A |*| One -⚬ A
Definition Classes
override def fork: Done -⚬ Done |*| Done
Definition Classes
override def forkNeed: Need |*| Need -⚬ Need
Definition Classes
override def fulfill[A]: Val[A] |*| Neg[A] -⚬ One
Definition Classes
override def id[A]: A -⚬ A
Definition Classes
override def inflate[A]: Need -⚬ Neg[A]
Definition Classes
override def injectL[A, B]: A -⚬ A |+| B
Definition Classes
override def injectLWhenDone[A, B]: Done |*| A -⚬ Done |*| A |+| B
Definition Classes
override def injectR[A, B]: B -⚬ A |+| B
Definition Classes
override def injectRWhenDone[A, B]: Done |*| B -⚬ A |+| Done |*| B
Definition Classes
override def introFst[B]: B -⚬ One |*| B
Definition Classes
override def introSnd[A]: A -⚬ A |*| One
Definition Classes
override def join: Done |*| Done -⚬ Done
Definition Classes
Definition Classes
override def joinNeed: Need -⚬ Need |*| Need
Definition Classes
Definition Classes
Definition Classes
Definition Classes
override def liftEither[A, B]: Val[Either[A, B]] -⚬ Val[A] |+| Val[B]
Definition Classes
override def liftNegPair[A, B]: Neg[(A, B)] -⚬ Neg[A] |*| Neg[B]
Definition Classes
override def liftPair[A, B]: Val[(A, B)] -⚬ Val[A] |*| Val[B]
Definition Classes
override def mapVal[A, B](f: A => B): Val[A] -⚬ Val[B]
Definition Classes
override def need: Need -⚬ One
Definition Classes
override def neglect[A]: Val[A] -⚬ Done
Definition Classes
override def pack[F[_]]: F[Rec[F]] -⚬ Rec[F]
Definition Classes
override def par[A, B, C, D](f: A -⚬ B, g: C -⚬ D): A |*| C -⚬ B |*| D
Definition Classes
override def promise[A]: One -⚬ Neg[A] |*| Val[A]
Definition Classes
Definition Classes
Definition Classes
Definition Classes
override def rec[A, B](f: A -⚬ B => A -⚬ B): A -⚬ B
Definition Classes
Definition Classes
override def release[R]: Res[R] -⚬ Done
Definition Classes
override def releaseAsync[R, A, B](f: (R, A) => Async[B]): Res[R] |*| Val[A] -⚬ Val[B]
Definition Classes
Definition Classes
override def signalChoice[A, B]: Need |*| A |&| B -⚬ A |&| B
Definition Classes
override def signalEither[A, B]: A |+| B -⚬ Done |*| A |+| B
Definition Classes
override def swap[A, B]: A |*| B -⚬ B |*| A
Definition Classes
override def tryAcquireAsync[A, R, B, E](acquire: A => Async[Either[E, (R, B)]], release: Option[R => Async[Unit]]): Val[A] -⚬ Val[E] |+| Res[R] |*| Val[B]
Definition Classes
override 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]
Definition Classes
override 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]
Definition Classes
override def unliftNegPair[A, B]: Neg[A] |*| Neg[B] -⚬ Neg[(A, B)]
Definition Classes
override def unliftPair[A, B]: Val[A] |*| Val[B] -⚬ Val[(A, B)]
Definition Classes
override def unpack[F[_]]: Rec[F] -⚬ F[Rec[F]]
Definition Classes

Inherited methods

def acquireAsync[A, R, B](acquire: A => Async[(R, B)], release: Option[R => Async[Unit]]): Val[A] -⚬ Res[R] |*| Val[B]
Inherited from
ScalaDSL
def coDistributeR[A, B, C]: A |*| C |&| B |*| C -⚬ A |&| B |*| C

Inverse of coFactorR.

Inherited from
CoreDSL
def coFactorL[A, B, C]: A |*| B |&| C -⚬ A |*| B |&| A |*| C
Inherited from
CoreDSL
def coFactorR[A, B, C]: A |&| B |*| C -⚬ A |*| C |&| B |*| C
Inherited from
CoreDSL
def cocrash[A, B](msg: String): Need |*| A -⚬ Need |*| B
Inherited from
CrashDSL
def crashd(msg: String): Done -⚬ Done
Inherited from
CrashDSL
def crashn(msg: String): Need -⚬ Need
Inherited from
CrashDSL
override def delay(d: FiniteDuration): Done -⚬ Done
Definition Classes
Inherited from
ScalaDSL
def delayNeed: Need -⚬ Neg[FiniteDuration]
Inherited from
ScalaDSL
def delayNeed(d: FiniteDuration): Need -⚬ Need
Inherited from
TimerDSL
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.

Inherited from
CoreDSL
def dup[A]: Val[A] -⚬ Val[A] |*| Val[A]
Inherited from
ScalaDSL
def dupNeg[A]: Neg[A] |*| Neg[A] -⚬ Neg[A]
Inherited from
ScalaDSL
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.

Type Params
A

additional parameter of the operation

B

additional output of the operation

R

type of the resource

Value Params
f

the effectful operation

Inherited from
ScalaDSL
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.

Inherited from
ScalaDSL
def elimFst[A, B](f: A -⚬ One): A |*| B -⚬ B
Inherited from
CoreDSL
def elimSnd[A, B](f: B -⚬ One): A |*| B -⚬ A
Inherited from
CoreDSL
def factorL[A, B, C]: A |*| B |+| A |*| C -⚬ A |*| B |+| C

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

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

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

Inherited from
CoreDSL
def fork[A, B](f: Done -⚬ A, g: Done -⚬ B): Done -⚬ A |*| B
Inherited from
CoreDSL
def forkNeed[A, B](f: A -⚬ Need, g: B -⚬ Need): A |*| B -⚬ Need
Inherited from
CoreDSL
def introFst[A, X](f: One -⚬ X): A -⚬ X |*| A
Inherited from
CoreDSL
def introSnd[A, X](f: One -⚬ X): A -⚬ A |*| X
Inherited from
CoreDSL
def join[A, B](f: A -⚬ Done, g: B -⚬ Done): A |*| B -⚬ Done
Inherited from
CoreDSL
def joinNeed[A, B](f: Need -⚬ A, g: Need -⚬ B): Need -⚬ A |*| B
Inherited from
CoreDSL
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.

Type Params
A

additional parameter of the release function

B

additional data produced by the release function

R

type of the resource

Value Params
f

the release function

Inherited from
ScalaDSL
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]
Inherited from
ScalaDSL
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]
Inherited from
ScalaDSL
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.

Type Params
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 Params
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

Inherited from
ScalaDSL
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]
Inherited from
ScalaDSL
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.

Type Params
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 Params
release

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

Inherited from
ScalaDSL
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]
Inherited from
ScalaDSL
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.

Type Params
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 Params
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

Inherited from
ScalaDSL
def unliftEither[A, B]: Val[A] |+| Val[B] -⚬ Val[Either[A, B]]
Inherited from
ScalaDSL