final case class Right[+B](b: B) extends Ior[Nothing, B] with Product with Serializable
- Alphabetic
- By Inheritance
- Right
- Ior
- Serializable
- Serializable
- Product
- Equals
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
- new Right(b: B)
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
===[AA >: Nothing, BB >: B](that: Ior[AA, BB])(implicit AA: Eq[AA], BB: Eq[BB]): Boolean
- Definition Classes
- Ior
-
final
def
addLeft[AA >: Nothing](left: AA)(implicit AA: Semigroup[AA]): Ior[AA, B]
When a Left value is present in the Ior, combine it will the value specified.
When a Left value is present in the Ior, combine it will the value specified.
When the Left value is absent, set it to the value specified.
Example:
scala> import cats.data.Ior scala> import cats.implicits._ scala> val ior1 = "abc".leftIor[Int] scala> ior1.addLeft("def") res0: Ior[String, Int] = Left(abcdef) scala> val ior2 = 123.rightIor[String] scala> ior2.addLeft("abc") res1: cats.data.Ior[String,Int] = Both(abc,123) scala> val ior3 = Ior.Both("abc",123) scala> ior3.addLeft("def") res2: Ior[String, Int] = Both(abcdef,123)
- Definition Classes
- Ior
-
final
def
addRight[BB >: B](right: BB)(implicit BB: Semigroup[BB]): Ior[Nothing, BB]
When a Right value is present in the Ior, combine it will the value specified.
When a Right value is present in the Ior, combine it will the value specified.
When the Right value is absent, set it to the value specified.
Example:
scala> import cats.data.Ior scala> import cats.implicits._ scala> val ior1 = "abc".leftIor[Int] scala> ior1.addRight(123) res0: Ior[String, Int] = Both(abc,123) scala> val ior2 = 123.rightIor[String] scala> ior2.addRight(123) res1: Ior[String, Int] = Right(246) scala> val ior3 = Ior.Both("abc",123) scala> ior3.addRight(123) res2: Ior[String, Int] = Both(abc,246)
- Definition Classes
- Ior
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
- val b: B
-
final
def
bimap[C, D](fa: (Nothing) ⇒ C, fb: (B) ⇒ D): Ior[C, D]
Example:
Example:
scala> import cats.data.Ior scala> import cats.implicits._ scala> "abc".leftIor[Int].bimap(_.length, identity) res0: Ior[Int, Int] = Left(3) scala> 123.rightIor[String].bimap(_.length, identity) res1: Ior[Int, Int] = Right(123) scala> Ior.Both("abc", 123).bimap(_.length, identity) res2: Ior[Int, Int] = Both(3,123)
- Definition Classes
- Ior
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native() @IntrinsicCandidate()
-
final
def
combine[AA >: Nothing, BB >: B](that: Ior[AA, BB])(implicit AA: Semigroup[AA], BB: Semigroup[BB]): Ior[AA, BB]
Example:
Example:
scala> import cats.data.Ior scala> import cats.implicits._ scala> "abc".leftIor[Int].combine("other".leftIor[Int]) res0: Ior[String, Int] = Left(abcother) scala> "abc".leftIor[Int].combine(456.rightIor[String]) res1: Ior[String, Int] = Both(abc,456) scala> 123.rightIor[String].combine("other".leftIor[Int]) res2: Ior[String, Int] = Both(other,123) scala> Ior.Both("abc", 123).combine(Ior.Both("other",456)) res3: Ior[String, Int] = Both(abcother,579) scala> Ior.Both("abc", 123).combine("other".leftIor[Int]) res3: Ior[String, Int] = Both(abcother,123) scala> Ior.Both("abc", 123).combine(456.rightIor[String]) res3: Ior[String, Int] = Both(abc,579)
- Definition Classes
- Ior
-
final
def
compare[AA >: Nothing, BB >: B](that: Ior[AA, BB])(implicit AA: Order[AA], BB: Order[BB]): Int
- Definition Classes
- Ior
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
exists(p: (B) ⇒ Boolean): Boolean
Example:
Example:
scala> import cats.data.Ior scala> import cats.implicits._ scala> "abc".leftIor[Int].exists(_ > 100) res0: Boolean = false scala> 123.rightIor[String].exists(_ > 100) res1: Boolean = true scala> Ior.Both("abc", 123).exists(_ > 100) res2: Boolean = true
- Definition Classes
- Ior
-
final
def
flatMap[AA >: Nothing, D](f: (B) ⇒ Ior[AA, D])(implicit AA: Semigroup[AA]): Ior[AA, D]
Example:
Example:
scala> import cats.data.Ior scala> import cats.implicits._ scala> "abc".leftIor[Int].flatMap(i => 456.rightIor[String]) res0: Ior[String, Int] = Left(abc) scala> 123.rightIor[String].flatMap(i => (i * 2).rightIor[String]) res1: Ior[String, Int] = Right(246) scala> 123.rightIor[String].flatMap(_ => "error".leftIor[Int]) res2: Ior[String, Int] = Left(error) scala> Ior.Both("abc", 123).flatMap(_ => 456.rightIor[String]) res3: Ior[String, Int] = Both(abc,456) scala> Ior.Both("abc", 123).flatMap(_ => "error".leftIor[Int]) res4: Ior[String, Int] = Left(abcerror) scala> Ior.Both("abc", 123).flatMap(_ => Ior.Both("error",456)) res5: Ior[String, Int] = Both(abcerror,456)
- Definition Classes
- Ior
-
final
def
fold[C](fa: (Nothing) ⇒ C, fb: (B) ⇒ C, fab: (Nothing, B) ⇒ C): C
Example:
Example:
scala> import cats.data.Ior scala> import cats.implicits._ scala> val rightF: Int => String = _.show scala> val bothF: (String,Int) => String = (a,b) => a.combine(b.show) scala> val ior1 = "abc".leftIor[Int] scala> ior1.fold(identity, rightF, bothF) res0: String = abc scala> val ior2 = 123.rightIor[String] scala> ior2.fold(identity, rightF, bothF) res1: String = 123 scala> val ior3 = Ior.Both("abc", 123) scala> ior3.fold(identity, rightF, bothF) res2: String = abc123
- Definition Classes
- Ior
-
final
def
foldLeft[C](c: C)(f: (C, B) ⇒ C): C
Example:
Example:
scala> import cats.data.Ior scala> import cats.implicits._ scala> "abc".leftIor[Int].foldLeft(List(456))((c,b) => b :: c) res0: List[Int] = List(456) scala> 123.rightIor[String].foldLeft(List(456))((c,b) => b :: c) res1: List[Int] = List(123, 456) scala> Ior.Both("abc", 123).foldLeft(List(456))((c,b) => b :: c) res2: List[Int] = List(123, 456)
- Definition Classes
- Ior
-
final
def
foldRight[C](lc: Eval[C])(f: (B, Eval[C]) ⇒ Eval[C]): Eval[C]
- Definition Classes
- Ior
-
final
def
forall(p: (B) ⇒ Boolean): Boolean
Example:
Example:
scala> import cats.data.Ior scala> import cats.implicits._ scala> "abc".leftIor[Int].forall(_ > 100) res0: Boolean = true scala> 123.rightIor[String].forall(_ > 150) res1: Boolean = false scala> Ior.Both("abc", 123).forall(_ > 100) res2: Boolean = true
- Definition Classes
- Ior
-
final
def
foreach(f: (B) ⇒ Unit): Unit
Example:
Example:
scala> import cats.data.Ior scala> import cats.implicits._ // Nothing to show scala> "abc".leftIor[Int].foreach(println) res0: Unit = () // 123 to be shown scala> 123.rightIor[String].foreach(println) res1: Unit = () 123 to be shown scala> Ior.both("abc", 123).foreach(println) res2: Unit = ()
- Definition Classes
- Ior
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @IntrinsicCandidate()
-
final
def
getOrElse[BB >: B](bb: ⇒ BB): BB
Example:
Example:
scala> import cats.data.Ior scala> import cats.implicits._ scala> "abc".leftIor[Int].getOrElse(456) res0: Int = 456 scala> 123.rightIor[String].getOrElse(456) res1: Int = 123 scala> Ior.Both("abc", 123).getOrElse(456) res2: Int = 123
- Definition Classes
- Ior
-
final
def
isBoth: Boolean
- Definition Classes
- Ior
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
isLeft: Boolean
Example:
Example:
scala> import cats.data.Ior scala> import cats.implicits._ scala> "abc".leftIor[Int].isLeft res0: Boolean = true scala> 123.rightIor[String].isLeft res1: Boolean = false scala> Ior.Both("abc", 123).isLeft res2: Boolean = false
- Definition Classes
- Ior
-
final
def
isRight: Boolean
- Definition Classes
- Ior
-
final
def
left: Option[Nothing]
Example:
Example:
scala> import cats.data.Ior scala> import cats.implicits._ scala> "abc".leftIor[Int].left res0: Option[String] = Some(abc) scala> 123.rightIor[String].left res1: Option[String] = None scala> Ior.Both("abc", 123).left res2: Option[String] = Some(abc)
- Definition Classes
- Ior
-
final
def
leftMap[C](f: (Nothing) ⇒ C): Ior[C, B]
Example:
Example:
scala> import cats.data.Ior scala> import cats.implicits._ scala> "abc".leftIor[Int].leftMap(_.length) res0: Ior[Int, Int] = Left(3) scala> 123.rightIor[String].leftMap(_.length) res1: Ior[Int, Int] = Right(123) scala> Ior.Both("abc", 123).leftMap(_.length) res2: Ior[Int, Int] = Both(3,123)
- Definition Classes
- Ior
-
final
def
map[D](f: (B) ⇒ D): Ior[Nothing, D]
Example:
Example:
scala> import cats.data.Ior scala> import cats.implicits._ scala> "abc".leftIor[Int].map(_ * 2) res0: Ior[String, Int] = Left(abc) scala> 123.rightIor[String].map(_ * 2) res1: Ior[String, Int] = Right(246) scala> Ior.Both("abc", 123).map(_ * 2) res2: Ior[String, Int] = Both(abc,246)
- Definition Classes
- Ior
-
final
def
merge[AA >: Nothing](implicit ev: <:<[B, AA], AA: Semigroup[AA]): AA
- Definition Classes
- Ior
-
final
def
mergeLeft[AA >: Nothing](implicit ev: <:<[B, AA]): AA
- Definition Classes
- Ior
-
final
def
mergeRight[AA >: Nothing](implicit ev: <:<[B, AA]): AA
- Definition Classes
- Ior
-
final
def
mergeWith[AA >: Nothing](f: (Nothing, B) ⇒ AA)(implicit ev: <:<[B, AA]): AA
- Definition Classes
- Ior
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @IntrinsicCandidate()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @IntrinsicCandidate()
-
final
def
onlyBoth: Option[(Nothing, B)]
Example:
Example:
scala> import cats.data.Ior scala> import cats.implicits._ scala> "abc".leftIor[Int].onlyBoth res0: Option[(String, Int)] = None scala> 123.rightIor[String].onlyBoth res1: Option[(String, Int)] = None scala> Ior.Both("abc", 123).onlyBoth res2: Option[(String, Int)] = Some((abc,123))
- Definition Classes
- Ior
-
final
def
onlyLeft: Option[Nothing]
Example:
Example:
scala> import cats.data.Ior scala> import cats.implicits._ scala> "abc".leftIor[Int].onlyLeft res0: Option[String] = Some(abc) scala> 123.rightIor[String].onlyLeft res1: Option[String] = None scala> Ior.Both("abc", 123).onlyLeft res2: Option[String] = None
- Definition Classes
- Ior
-
final
def
onlyLeftOrRight: Option[Either[Nothing, B]]
Example:
Example:
scala> import cats.data.Ior scala> import cats.implicits._ scala> "abc".leftIor[Int].onlyLeftOrRight res0: Option[Either[String, Int]] = Some(Left(abc)) scala> 123.rightIor[String].onlyLeftOrRight res1: Option[Either[String, Int]] = Some(Right(123)) scala> Ior.Both("abc", 123).onlyLeftOrRight res2: Option[Either[String, Int]] = None
- Definition Classes
- Ior
-
final
def
onlyRight: Option[B]
Example:
Example:
scala> import cats.data.Ior scala> import cats.implicits._ scala> "abc".leftIor[Int].onlyRight res0: Option[Int] = None scala> 123.rightIor[String].onlyRight res1: Option[Int] = Some(123) scala> Ior.Both("abc", 123).onlyRight res2: Option[Int] = None
- Definition Classes
- Ior
-
final
def
pad: (Option[Nothing], Option[B])
Example:
Example:
scala> import cats.data.Ior scala> import cats.implicits._ scala> "abc".leftIor[Int].pad res0: (Option[String], Option[Int]) = (Some(abc),None) scala> 123.rightIor[String].pad res1: (Option[String], Option[Int]) = (None,Some(123)) scala> Ior.Both("abc", 123).pad res2: (Option[String], Option[Int]) = (Some(abc),Some(123))
- Definition Classes
- Ior
-
final
def
putLeft[C](left: C): Ior[C, B]
Example:
Example:
scala> import cats.data.Ior scala> import cats.implicits._ scala> val ior1 = "abc".leftIor[Int] scala> ior1.putLeft(true) res0: Ior[Boolean, Int] = Left(true) scala> val ior2 = 123.rightIor[String] scala> ior2.putLeft(false) res1: Ior[Boolean, Int] = Both(false,123) scala> val ior3 = Ior.Both("abc",123) scala> ior3.putLeft(true) res2: Ior[Boolean, Int] = Both(true,123)
- Definition Classes
- Ior
-
final
def
putRight[C](right: C): Ior[Nothing, C]
Example:
Example:
scala> import cats.data.Ior scala> import cats.implicits._ scala> val ior1 = "abc".leftIor[Int] scala> ior1.putRight(123L) res0: Ior[String, Long] = Both(abc,123) scala> val ior2 = 123.rightIor[String] scala> ior2.putRight(123L) res1: Ior[String, Long] = Right(123) scala> val ior3 = Ior.Both("abc",123) scala> ior3.putRight(123L) res2: Ior[String, Long] = Both(abc,123)
- Definition Classes
- Ior
-
final
def
right: Option[B]
Example:
Example:
scala> import cats.data.Ior scala> import cats.implicits._ scala> "abc".leftIor[Int].right res0: Option[Int] = None scala> 123.rightIor[String].right res1: Option[Int] = Some(123) scala> Ior.Both("abc", 123).right res2: Option[Int] = Some(123)
- Definition Classes
- Ior
-
final
def
show[AA >: Nothing, BB >: B](implicit AA: Show[AA], BB: Show[BB]): String
- Definition Classes
- Ior
-
final
def
swap: Ior[B, Nothing]
Example:
Example:
scala> import cats.data.Ior scala> import cats.implicits._ scala> "abc".leftIor[Int].swap res0: Ior[Int, String] = Right(abc) scala> 123.rightIor[String].swap res1: Ior[Int, String] = Left(123) scala> Ior.Both("abc", 123).swap res2: Ior[Int, String] = Both(123,abc)
- Definition Classes
- Ior
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
final
def
to[F[_], BB >: B](implicit F: Alternative[F]): F[BB]
Example:
Example:
scala> import cats.data.Ior scala> import cats.implicits._ scala> "abc".leftIor[Int].to[List, Int] res0: List[Int] = List() scala> 123.rightIor[String].to[List, Int] res1: List[Int]= List(123) scala> Ior.Both("abc", 123).to[List, Int] res2: List[Int] = List(123)
- Definition Classes
- Ior
-
final
def
toEither: Either[Nothing, B]
Example:
Example:
scala> import cats.data.Ior scala> import cats.implicits._ scala> "abc".leftIor[Int].toEither res0: Either[String, Int] = Left(abc) scala> 123.rightIor[String].toEither res1: Either[String, Int]= Right(123) scala> Ior.Both("abc", 123).toEither res2: Either[String, Int] = Right(123)
- Definition Classes
- Ior
-
final
def
toIorNec[AA >: Nothing]: IorNec[AA, B]
- Definition Classes
- Ior
-
final
def
toIorNel[AA >: Nothing]: IorNel[AA, B]
Example:
Example:
scala> import cats.data.Ior scala> import cats.implicits._ scala> "abc".leftIor[Int].toIorNel res0: IorNel[String, Int] = Left(NonEmptyList(abc)) scala> 123.rightIor[String].toIorNel res1: IorNel[String, Int]= Right(123) scala> Ior.Both("abc", 123).toIorNel res2: IorNel[String, Int] = Both(NonEmptyList(abc),123)
- Definition Classes
- Ior
-
final
def
toIorNes[AA >: Nothing](implicit O: Order[AA]): IorNes[AA, B]
Example:
Example:
scala> import cats.data.Ior scala> import cats.implicits._ scala> "abc".leftIor[Int].toIorNes res0: IorNes[String, Int] = Left(TreeSet(abc)) scala> 123.rightIor[String].toIorNes res1: IorNes[String, Int]= Right(123) scala> Ior.Both("abc", 123).toIorNes res2: IorNes[String, Int] = Both(TreeSet(abc),123)
- Definition Classes
- Ior
-
final
def
toList: List[B]
Example:
Example:
scala> import cats.data.Ior scala> import cats.implicits._ scala> "abc".leftIor[Int].toList res0: List[Int] = List() scala> 123.rightIor[String].toList res1: List[Int]= List(123) scala> Ior.Both("abc", 123).toList res2: List[Int] = List(123)
- Definition Classes
- Ior
-
final
def
toOption: Option[B]
Example:
Example:
scala> import cats.data.Ior scala> import cats.implicits._ scala> "abc".leftIor[Int].toOption res0: Option[Int] = None scala> 123.rightIor[String].toOption res1: Option[Int]= Some(123) scala> Ior.Both("abc", 123).toOption res2: Option[Int] = Some(123)
- Definition Classes
- Ior
-
final
def
toValidated: Validated[Nothing, B]
Example:
Example:
scala> import cats.data.Ior scala> import cats.implicits._ scala> "abc".leftIor[Int].toValidated res0: Validated[String, Int] = Invalid(abc) scala> 123.rightIor[String].toValidated res1: Validated[String, Int]= Valid(123) scala> Ior.Both("abc", 123).toValidated res2: Validated[String, Int] = Valid(123)
- Definition Classes
- Ior
-
final
def
traverse[F[_], AA >: Nothing, D](g: (B) ⇒ F[D])(implicit F: Applicative[F]): F[Ior[AA, D]]
Example
Example
scala> import cats.data.Ior scala> import cats.implicits._ scala> "abc".leftIor[Int].traverse(i => List(i, i * 2)) res0: List[Ior[String,Int]] = List(Left(abc)) scala> 123.rightIor[String].traverse(i => List(i, i * 2)) res1: List[Ior[String,Int]] = List(Right(123), Right(246)) scala> Ior.both("abc", 123).traverse(i => List(i, i * 2)) res2: List[Ior[String,Int]] = List(Both(abc,123), Both(abc,246))
- Definition Classes
- Ior
-
final
def
unwrap: Either[Either[Nothing, B], (Nothing, B)]
Example:
Example:
scala> import cats.data.Ior scala> import cats.implicits._ scala> "abc".leftIor[Int].unwrap res0: Either[Either[String, Int], (String, Int)] = Left(Left(abc)) scala> 123.rightIor[String].unwrap res1: Either[Either[String, Int], (String, Int)] = Left(Right(123)) scala> Ior.Both("abc", 123).unwrap res2: Either[Either[String, Int], (String, Int)] = Right((abc,123))
- Definition Classes
- Ior
-
final
def
valueOr[BB >: B](f: (Nothing) ⇒ BB)(implicit BB: Semigroup[BB]): BB
Example:
Example:
scala> import cats.data.Ior scala> import cats.implicits._ scala> "abc".leftIor[Int].valueOr(_.length) res0: Int = 3 scala> 123.rightIor[String].valueOr(_.length) res1: Int = 123 scala> Ior.Both("abc", 123).valueOr(_.length) res2: Int = 126
- Definition Classes
- Ior
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )