Callback that can short-circuit along the way when conditions you specify, aren't met.
Especially useful for event handlers such as key handlers, drag-and-drop handlers, etc, where you check a condition, perform an effect, check another condition, perform another effect, etc.
This is meant to be lightweight, and be immediately useful without the typical pain of imports, implicit conversions and extension methods then normally accompany monad transforms in Scala.
For a more generic (i.e. beyond Option) or comprehensive monad transformer use Cats or similar.
Attributes
- Companion
- object
- Graph
-
- Supertypes
-
class AnyValtrait Matchableclass Any
- Self type
Members list
Value members
Concrete methods
Alias for >>
.
Alias for >>
.
Where >>
is often associated with Monads, *>
is often associated with Applicatives.
Attributes
Sequence actions, discarding the value of the second argument.
Sequence actions, discarding the value of the second argument.
Attributes
Sequence a callback to run before this, discarding any value produced by it.
Sequence a callback to run before this, discarding any value produced by it.
Attributes
Convenient version of <<
that accepts an Option
Convenient version of <<
that accepts an Option
Attributes
Sequence a callback to run after this, discarding any value produced by this.
Sequence a callback to run after this, discarding any value produced by this.
Attributes
Alias for flatMap
.
Alias for flatMap
.
Attributes
Wraps this callback in a try-finally
block and runs the given callback in the finally
clause, after the current callback completes, be it in error or success.
Wraps this callback in a try-finally
block and runs the given callback in the finally
clause, after the current callback completes, be it in error or success.
Attributes
Discard the value produced by this callback.
Discard the value produced by this callback.
Attributes
Discard the value produced by this callback.
Discard the value produced by this callback.
This method allows you to be explicit about the type you're discarding (which may change in future).
Attributes
Conditional execution of this callback.
Conditional execution of this callback.
Value parameters
- cond
-
The condition required to be
true
for this callback to execute.
Attributes
Conditional execution of this callback.
Conditional execution of this callback.
Value parameters
- cond
-
The condition required to be
true
for this callback to execute.
Attributes
Alias for orElse
.
Alias for orElse
.
Attributes
Alias for map
.
Alias for map
.