Skip to content

Commit

Permalink
Unseal InjectK to allow for extension by other libraries
Browse files Browse the repository at this point in the history
  • Loading branch information
andyscott committed May 1, 2017
1 parent f686984 commit 102f963
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions core/src/main/scala/cats/InjectK.scala
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ import cats.data.EitherK
*
* @see [[http://www.staff.science.uu.nl/~swier004/publications/2008-jfp.pdf]]
*/
sealed abstract class InjectK[F[_], G[_]] {
trait InjectK[F[_], G[_]] extends Serializable {
def inj: FunctionK[F, G]

def prj: FunctionK[G, λ[α => Option[F[α]]]]

def apply[A](fa: F[A]): G[A] = inj(fa)
final def apply[A](fa: F[A]): G[A] = inj(fa)

def unapply[A](ga: G[A]): Option[F[A]] = prj(ga)
final def unapply[A](ga: G[A]): Option[F[A]] = prj(ga)
}

private[cats] sealed abstract class InjectKInstances {
Expand Down

0 comments on commit 102f963

Please sign in to comment.