Result
Helpers for building and combining Result values (Either[LLMError, A]).
val all: Result[Seq[Int]] = Result.traverse(lines)(parseLine)
Attributes
- Source
- package.scala
- Graph
-
- Supertypes
- Self type
-
Result.type
Members list
Value members
Concrete methods
Wraps error as a failed result (Left(error)).
Right with the option's value, or Left(error) for None.
Right with the option's value, or Left(error) for None.
Value parameters
- error
-
by-name: evaluated only when
optisNone
Attributes
- Source
- package.scala
Runs operation and returns its value as a Right. A non-fatal exception it throws becomes a Left, mapped by Safety.fromThrowable: a CancelledError, a NetworkError (a connection failure or timeout) or, for anything else, an UnknownError.
Runs operation and returns its value as a Right. A non-fatal exception it throws becomes a Left, mapped by Safety.fromThrowable: a CancelledError, a NetworkError (a connection failure or timeout) or, for anything else, an UnknownError.
Attributes
- Source
- package.scala
Collects results into a result of their values: the values in order, or the first Left.
Collects results into a result of their values: the values in order, or the first Left.
Attributes
- Source
- package.scala
Wraps value as a successful result (Right(value)).
Applies f to each element in order and collects the values, stopping at the first Left: f is not called on any element after the first failure, so side effects and expensive work in f stop there too.
Applies f to each element in order and collects the values, stopping at the first Left: f is not called on any element after the first failure, so side effects and expensive work in f stop there too.
Attributes
- Source
- package.scala
Runs validator on every item and collects every error, unlike traverse, which stops at the first: Left with all the errors in item order when any item fails, otherwise Right with the validated values in order.
Runs validator on every item and collects every error, unlike traverse, which stops at the first: Left with all the errors in item order when any item fails, otherwise Right with the validated values in order.
Attributes
- Source
- package.scala
