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.
Since
1.0
Note
Prior to cats 1.0, Inject handled injection for type
constructors. For injection of type constructors, use InjectK.
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