trait Choice[F[_, _]] extends Category[F]
- Annotations
- @implicitNotFound( ... ) @typeclass( ... , ... )
- Source
- Choice.scala
- Alphabetic
- By Inheritance
- Choice
- Category
- Compose
- Serializable
- Serializable
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Abstract Value Members
-
abstract
def
choice[A, B, C](f: F[A, C], g: F[B, C]): F[Either[A, B], C]
Given two
F
s (f
andg
) with a common target type, create a newF
with the same target type, but with a source type of eitherf
's source type ORg
's source type.Given two
F
s (f
andg
) with a common target type, create a newF
with the same target type, but with a source type of eitherf
's source type ORg
's source type.Example:
scala> import cats.implicits._ scala> val b: Boolean => String = _.toString + " is a boolean" scala> val i: Int => String = _.toString + " is an integer" scala> val f: (Either[Boolean, Int]) => String = b ||| i scala> f(Right(3)) res0: String = 3 is an integer scala> f(Left(false)) res0: String = false is a boolean
- Annotations
- @op( "|||" , true )
-
abstract
def
compose[A, B, C](f: F[B, C], g: F[A, B]): F[A, C]
- Definition Classes
- Compose
- Annotations
- @op( "<<<" , true )
-
abstract
def
id[A]: F[A, A]
- Definition Classes
- Category
Concrete 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
- def algebra[A]: Monoid[F[A, A]]
- def algebraK: MonoidK[[α]F[α, α]]
-
def
andThen[A, B, C](f: F[A, B], g: F[B, C]): F[A, C]
- Definition Classes
- Compose
- Annotations
- @op( ">>>" , true )
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native() @IntrinsicCandidate()
-
def
codiagonal[A]: F[Either[A, A], A]
An
F
that, given a sourceA
on either the right or left side, will return that sameA
object.An
F
that, given a sourceA
on either the right or left side, will return that sameA
object.Example:
scala> import cats.implicits._ scala> val f: (Either[Int, Int]) => Int = Choice[Function1].codiagonal[Int] scala> f(Right(3)) res0: Int = 3 scala> f(Left(3)) res1: Int = 3
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @IntrinsicCandidate()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @IntrinsicCandidate()
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
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
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
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( ... )