Skip to content

Commit

Permalink
Remove Unapply syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
Luka Jacobowitz committed May 28, 2017
1 parent 796ebb4 commit f437a98
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 15 deletions.
15 changes: 8 additions & 7 deletions core/src/main/scala/cats/syntax/reducible.scala
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
package cats
package syntax

private[syntax] trait ReducibleSyntax1 {
implicit def catsSyntaxUReducible[FA](fa: FA)(implicit U: Unapply[Reducible, FA]): Reducible.Ops[U.M, U.A] =
new Reducible.Ops[U.M, U.A] {
val self = U.subst(fa)
val typeClassInstance = U.TC
}

trait ReducibleSyntax extends Reducible.ToReducibleOps {
implicit final def catsSyntaxNestedReducible[F[_]: Reducible, G[_], A](fga: F[G[A]]): NestedReducibleOps[F, G, A] =
new NestedReducibleOps[F, G, A](fga)
}

final class NestedReducibleOps[F[_], G[_], A](val fga: F[G[A]]) extends AnyVal {
def reduceK(implicit F: Reducible[F], G: SemigroupK[G]): G[A] = F.reduceK(fga)
}

trait ReducibleSyntax extends Reducible.ToReducibleOps with ReducibleSyntax1
9 changes: 1 addition & 8 deletions core/src/main/scala/cats/syntax/traverse1.scala
Original file line number Diff line number Diff line change
@@ -1,11 +1,4 @@
package cats
package syntax

trait Traverse1Syntax extends Traverse1.ToTraverse1Ops {
implicit def catsSyntaxNestedTraverse1[F[_]: Traverse1, G[_], A](fga: F[G[A]]): NestedTraverse1Ops[F, G, A] =
new NestedTraverse1Ops[F, G, A](fga)
}

final class NestedTraverse1Ops[F[_], G[_], A](fga: F[G[A]])(implicit F: Traverse1[F]) {
def reduceK(implicit G: SemigroupK[G]): G[A] = F.reduceK(fga)
}
trait Traverse1Syntax extends Traverse1.ToTraverse1Ops

0 comments on commit f437a98

Please sign in to comment.