Inject

cats.Inject
See theInject companion object
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.

Attributes

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
Source
Inject.scala
Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Abstract methods

def inj: A => B
Implicitly added by catsRightInjectInstance

Attributes

Source
Inject.scala
def inj: A => B

Attributes

Source
Inject.scala
def prj: B => Option[A]
Implicitly added by catsRightInjectInstance

Attributes

Source
Inject.scala
def prj: B => Option[A]

Attributes

Source
Inject.scala

Concrete methods

final def apply(a: A): B
Implicitly added by catsRightInjectInstance

Attributes

Source
Inject.scala
final def apply(a: A): B

Attributes

Source
Inject.scala
final def unapply(b: B): Option[A]
Implicitly added by catsRightInjectInstance

Attributes

Source
Inject.scala
final def unapply(b: B): Option[A]

Attributes

Source
Inject.scala