-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Luka Jacobowitz
committed
May 28, 2017
1 parent
796ebb4
commit f437a98
Showing
2 changed files
with
9 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |