Sword => ??? case Antidote => ??? } // —————————————————————————- ! def buy(item: Item) = item match { case sword: Sword => ??? } // ↑ ίϯύΠϧΤϥʔ <console>:29: warning: match may not be exhaustive. It would fail on the following input: Antidote def buy(item: Item) = item match { ^ error: No warnings can be incurred under -Xfatal-warnings.
=> Option[B] ! // failableAToB: A => Option[B] found.flatMap(failableAToB) // => Option[B] ! for { a <- found b <- failableAToB(a) c <- failableBToC(b) d <- failableCToD(c) } yield dToE(d) // => Option[E]
} // ↑ ϊϯϒϩοΩϯά ! f onComplete { case Success(result) => ??? case Failure(thrown) => ??? } ! f onSuccess { case result => ??? } f onFailure { case thrown => ??? }
// aToB: A => B fa.map(aToB) // => Future[B] ! // longTimeAToB: A => Future[B] fa.flatMap(longTimeAToB) // => Future[B] ! for { a <- fa b <- fb c <- longTimeC(a, b) } yield cToD(c) // => Future[D]