OutputFactory

besom.internal.OutputFactory

These factory methods should be the only way to create Output instances in user code.

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object Output.type

Members list

Value members

Concrete methods

def apply[A](value: A)(using Context): Output[A]

Creates an Output with the given value

Creates an Output with the given value

Attributes

See also

secret for creating an Output with a secret value

def eval[F[_] : ToFuture, A](value: F[A])(implicit evidence$3: ToFuture[F], Context): Output[A]

Creates an Output that evaluates given effectful computation.

Creates an Output that evaluates given effectful computation.

The type F[_] is constrained to types for which an instance of Result.ToFuture is defined.

Besom offers the following instances:

  • besom-core provides a ToFuture instance for scala.concurrent.Future
  • besom-zio provides a ToFuture instance for zio.Task
  • besom-cats provides a ToFuture instance for cats.effect.IO

Type parameters

A

the type of the value

F

the effect type

Value parameters

value

the value to wrap in an Output

Attributes

def fail(t: Throwable)(using Context): Output[Nothing]

Creates a failed Output containing given Throwable

Creates a failed Output containing given Throwable

Attributes

def secret[A](value: A)(using Context): Output[A]

Creates an Output that is known to be a secret

Creates an Output that is known to be a secret

Attributes

def sequence[A, CC <: (Iterable), To](coll: CC[Output[A]])(using BuildFrom[CC[Output[A]], A, To], Context): Output[To]

Creates an Output of a collection from a collection of Outputs.

Creates an Output of a collection from a collection of Outputs.

Attributes

See also

parSequence for parallel execution

def traverse[A, CC <: (Iterable), B, To](coll: CC[A])(f: A => Output[B])(using BuildFrom[CC[Output[B]], B, To], Context): Output[To]

Creates an Output of a collection from a collection of values mapped with the function f

Creates an Output of a collection from a collection of values mapped with the function f

Value parameters

coll

the collection to map with f

f

the Output-returning function to apply to each element in the collection

Attributes

def unit(using Context): Output[Unit]

Creates an Output that contains Unit

Creates an Output that contains Unit

Attributes

def when[A](condition: => Input[Boolean])(a: => Optional[A])(using ctx: Context): Output[Option[A]]

Creates an Output with the given a if the given condition is true or returns None if the condition is false

Creates an Output with the given a if the given condition is true or returns None if the condition is false

Attributes