Inject

abstract class Inject[A, B]

Inject is a type class providing an injection from type A into type B. An injection is a function inj which does not destroy any information: for every b: B there is at most one a: A such that inj(a) = b.

Because of this all injections admit partial inverses prj which pair a value b: B back with a single value a: A.

See also:

InjectK for injection for cats.data.EitherK

Since:

1.0

Note:

Prior to cats 1.0, Inject handled injection for type constructors. For injection of type constructors, use InjectK.

Companion:
object
class Object
trait Matchable
class Any

Value members

Abstract methods

def inj: A => B
Implicitly added by catsRightInjectInstance
def inj: A => B
def prj: B => Option[A]
Implicitly added by catsRightInjectInstance
def prj: B => Option[A]

Concrete methods

final def apply(a: A): B
Implicitly added by catsRightInjectInstance
final def apply(a: A): B
final def unapply(b: B): Option[A]
Implicitly added by catsRightInjectInstance
final def unapply(b: B): Option[A]