ResultOps
Enriches Result[A] with combinators for error handling and side effects.
These methods parallel standard Either and Try combinators but are typed specifically for LLMError on the left side, making the failure domain explicit at each call site.
Attributes
- Graph
-
- Supertypes
-
class AnyValtrait Matchableclass Any
Members list
Value members
Concrete methods
Returns the success value, or default when the result is a Left.
Returns the success value, or default when the result is a Left.
Attributes
Transforms the error value without changing the success type. Leaves Right values untouched.
Transforms the error value without changing the success type. Leaves Right values untouched.
Value parameters
- f
-
transforms the
LLMError; must return anLLMError
Attributes
Returns this result when it is a Right, or evaluates alternative when it is a Left. The original error is discarded.
Returns this result when it is a Right, or evaluates alternative when it is a Left. The original error is discarded.
Attributes
Converts a matching Left into a Right using the supplied partial function.
Converts a matching Left into a Right using the supplied partial function.
If the partial function is not defined for the error, the original Left is returned unchanged. Right values pass through without invoking pf.
Value parameters
- pf
-
partial function from
LLMErrorto a recovery value
Attributes
Converts a matching Left into a new Result using the supplied partial function.
Converts a matching Left into a new Result using the supplied partial function.
Useful when the recovery operation can itself fail. If the partial function is not defined for the error, the original Left is returned unchanged. Right values pass through without invoking pf.
Value parameters
- pf
-
partial function from
LLMErrorto a newResult[B]
Attributes
Executes effect for its side effect when the result is a Right, then returns the original result unchanged. Useful for logging or metrics without breaking a for-comprehension chain.
Executes effect for its side effect when the result is a Right, then returns the original result unchanged. Useful for logging or metrics without breaking a for-comprehension chain.
Value parameters
- effect
-
side-effecting function invoked on success; its return value is discarded
Attributes
Executes effect for its side effect when the result is a Left, then returns the original result unchanged. Useful for logging errors without altering the failure path.
Executes effect for its side effect when the result is a Left, then returns the original result unchanged. Useful for logging errors without altering the failure path.
Value parameters
- effect
-
side-effecting function invoked on failure; its return value is discarded