abstract
class
Inject[A, B] extends AnyRef
Instance Constructors
-
new
Inject()
Abstract Value Members
-
abstract
def
inj: (A) ⇒ B
-
abstract
def
prj: (B) ⇒ Option[A]
Concrete Value Members
-
final
def
!=(arg0: Any): Boolean
-
final
def
##(): Int
-
final
def
==(arg0: Any): Boolean
-
final
def
apply(a: A): B
-
final
def
asInstanceOf[T0]: T0
-
def
clone(): AnyRef
-
-
-
def
finalize(): Unit
-
final
def
getClass(): Class[_]
-
def
hashCode(): Int
-
final
def
isInstanceOf[T0]: Boolean
-
-
final
def
notify(): Unit
-
final
def
notifyAll(): Unit
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
-
def
toString(): String
-
final
def
unapply(b: B): Option[A]
-
final
def
wait(): Unit
-
final
def
wait(arg0: Long, arg1: Int): Unit
-
final
def
wait(arg0: Long): Unit
Inject is a type class providing an injection from type
A
into typeB
. An injection is a functioninj
which does not destroy any information: for everyb: B
there is at most onea: A
such thatinj(a) = b
.Because of this all injections admit partial inverses
prj
which pair a valueb: B
back with a single valuea: A
.1.0
Prior to cats 1.0, Inject handled injection for type constructors. For injection of type constructors, use InjectK.
InjectK for injection for cats.data.EitherK