Skip to content

Commit

Permalink
typelevel#3112 adding implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
pk044 committed Nov 4, 2019
1 parent 134570b commit 194490e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions core/src/main/scala/cats/SemigroupK.scala
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,7 @@ import simulacrum.typeclass
new ComposedSemigroupK[F, G] {
val F = self
}

def sum[F[_]: SemigroupK : Functor, A, B](fa: F[A], fb: F[B])(implicit F: Functor[F]): F[Either[A,B]] =
combineK(F.map(fa)(Left(_)), F.map(fb)(Right(_)))
}

0 comments on commit 194490e

Please sign in to comment.