given_Monad_Option
Value members
Concrete methods
Extensions
Inherited extensions
extension (f: A => M[B])
@targetName("composeKleisliFlipped")
Right-to-left composition of Kleisli arrows.
Right-to-left composition of Kleisli arrows.
- Example
val ff1 = (x:Int) => Option(x +1) val ff2 = (x:Int) => Option(x +2) (ff2 <=< ff1) =<< Option(1) == Option(4)
- Inherited from
- Monad
@targetName("composeKleisli")
Left-to-right composition of Kleisli arrows.
Left-to-right composition of Kleisli arrows.
- Example
val ff1 = (x:Int) => Option(x +1) val ff2 = (x:Int) => Option(x +2) Option(1) >>= (ff1 >=> ff2) == Option(4)
- Inherited from
- Monad
extension (fa: M[A])
@targetName("dropLeft")
Sequentially compose two actions, discarding any value produced by the first, like sequencing operators (such as the semicolon) in imperative languages.
Sequentially compose two actions, discarding any value produced by the first, like sequencing operators (such as the semicolon) in imperative languages.
- Example
Option(1) >> Option(2) == Option(2)
- Inherited from
- Monad
@targetName("bind")
Sequentially compose two actions, passing any value produced by the first as an argument to the second.
Sequentially compose two actions, passing any value produced by the first as an argument to the second.
- Example
val f = (x:Int) => Option(x +1) Option(1) >>= f == Option(2)
- Inherited from
- Monad