2019-10-18から1日間の記事一覧

MonadErrorSyntax_2

).fold[B](ifEmpty: => B)(f: A => B): B OptionT(...).getOrElseF(default: => F[A])(implicit F: Monad[F]): F[A] ) emap ( _ \/> new Exception("error!!") ) ↓ \/> final def \/>[E](e: => E): E \/ A = o.toRight(self)(e) def OptionInstances#toRight…

Option#foreach

Noneはなにもしないよ /** Apply the given procedure $f to the option's value, * if it is nonempty. Otherwise, do nothing. * * @param f the procedure to apply. * @see map * @see flatMap */ @inline final def foreach[U](f: A => U) { if (!isEmp…

MonadErrorSyntax

)) map { case 1 => () } recoverWith { case e => Future.failed(new Exception("error!!")) } )) emap (_ == 1 either () or new Exception("error!!")) warn: adaptation of argument list by inserting () is deprecated either () => either (()) final…