Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make the implicit priority traits private. #1171

Merged
merged 1 commit into from
Jul 1, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions core/src/main/scala/cats/data/OneAnd.scala
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ private[data] sealed trait OneAndInstances extends OneAndLowPriority2 {
}
}

trait OneAndLowPriority0 {
private[data] trait OneAndLowPriority0 {
implicit val catsDataComonadForOneAnd: Comonad[OneAnd[List, ?]] =
new Comonad[OneAnd[List, ?]] {
def coflatMap[A, B](fa: OneAnd[List, A])(f: OneAnd[List, A] => B): OneAnd[List, B] = {
Expand All @@ -159,7 +159,7 @@ trait OneAndLowPriority0 {
}
}

trait OneAndLowPriority1 extends OneAndLowPriority0 {
private[data] trait OneAndLowPriority1 extends OneAndLowPriority0 {
implicit def catsDataFunctorForOneAnd[F[_]](implicit F: Functor[F]): Functor[OneAnd[F, ?]] =
new Functor[OneAnd[F, ?]] {
def map[A, B](fa: OneAnd[F, A])(f: A => B): OneAnd[F, B] =
Expand All @@ -168,7 +168,7 @@ trait OneAndLowPriority1 extends OneAndLowPriority0 {

}

trait OneAndLowPriority2 extends OneAndLowPriority1 {
private[data] trait OneAndLowPriority2 extends OneAndLowPriority1 {
implicit def catsDataTraverseForOneAnd[F[_]](implicit F: Traverse[F]): Traverse[OneAnd[F, ?]] =
new Traverse[OneAnd[F, ?]] {
def traverse[G[_], A, B](fa: OneAnd[F, A])(f: (A) => G[B])(implicit G: Applicative[G]): G[OneAnd[F, B]] = {
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/scala/cats/syntax/apply.scala
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package cats
package syntax

trait ApplySyntax1 {
private[syntax] trait ApplySyntax1 {
implicit def catsSyntaxUApply[FA](fa: FA)(implicit U: Unapply[Apply, FA]): Apply.Ops[U.M, U.A] =
new Apply.Ops[U.M, U.A] {
val self = U.subst(fa)
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/scala/cats/syntax/cartesian.scala
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package cats
package syntax

trait CartesianSyntax1 {
private[syntax] trait CartesianSyntax1 {
implicit def catsSyntaxUCartesian[FA](fa: FA)(implicit U: Unapply[Cartesian, FA]): CartesianOps[U.M, U.A] =
new CartesianOps[U.M, U.A] {
val self = U.subst(fa)
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/scala/cats/syntax/coflatMap.scala
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package cats
package syntax

trait CoflatMapSyntax1 {
private[syntax] trait CoflatMapSyntax1 {
implicit def catsSyntaxUCoflatMap[FA](fa: FA)(implicit U: Unapply[CoflatMap, FA]): CoflatMap.Ops[U.M, U.A] = new CoflatMap.Ops[U.M, U.A] {
val self = U.subst(fa)
val typeClassInstance = U.TC
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/scala/cats/syntax/comonad.scala
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package cats
package syntax

trait ComonadSyntax1 {
private[syntax] trait ComonadSyntax1 {
implicit def catsSyntaxUComonad[FA](fa: FA)(implicit U: Unapply[Comonad, FA]): Comonad.Ops[U.M, U.A] =
new Comonad.Ops[U.M, U.A] {
val self = U.subst(fa)
Expand Down
3 changes: 1 addition & 2 deletions core/src/main/scala/cats/syntax/contravariant.scala
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ package syntax

import cats.functor.Contravariant


trait ContravariantSyntax1 {
private[syntax] trait ContravariantSyntax1 {
implicit def catsSyntaxUContravariant[FA](fa: FA)(implicit U: Unapply[Contravariant, FA]): Contravariant.Ops[U.M, U.A] =
new Contravariant.Ops[U.M, U.A] {
val self = U.subst(fa)
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/scala/cats/syntax/flatMap.scala
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package cats
package syntax

trait FlatMapSyntax1 {
private[syntax] trait FlatMapSyntax1 {
implicit def catsSyntaxUFlatMap[FA](fa: FA)(implicit U: Unapply[FlatMap, FA]): FlatMapOps[U.M, U.A] =
new FlatMapOps[U.M, U.A](U.subst(fa))(U.TC)
}
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/scala/cats/syntax/foldable.scala
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package cats
package syntax

trait FoldableSyntax1 {
private[syntax] trait FoldableSyntax1 {
implicit def catsSyntaxUFoldable[FA](fa: FA)(implicit U: Unapply[Foldable, FA]): Foldable.Ops[U.M, U.A] =
new Foldable.Ops[U.M, U.A] {
val self = U.subst(fa)
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/scala/cats/syntax/functor.scala
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package cats
package syntax

trait FunctorSyntax1 {
private[syntax] trait FunctorSyntax1 {
implicit def catsSyntaxUFunctor[FA](fa: FA)(implicit U: Unapply[Functor, FA]): Functor.Ops[U.M, U.A] =
new Functor.Ops[U.M, U.A]{
val self = U.subst(fa)
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/scala/cats/syntax/invariant.scala
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package syntax

import cats.functor.Invariant

trait InvariantSyntax1 {
private[syntax] trait InvariantSyntax1 {
implicit def catsSyntaxUInvariant[FA](fa: FA)(implicit U: Unapply[Invariant, FA]): Invariant.Ops[U.M, U.A] =
new Invariant.Ops[U.M, U.A] {
val self = U.subst(fa)
Expand Down
4 changes: 0 additions & 4 deletions core/src/main/scala/cats/syntax/monadError.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,11 @@ package cats
package syntax

trait MonadErrorSyntax {

implicit def catsSyntaxMonadError[F[_], E, A](fa: F[A])(implicit F: MonadError[F, E]): MonadErrorOps[F, E, A] =
new MonadErrorOps(fa)

}

final class MonadErrorOps[F[_], E, A](fa: F[A])(implicit F: MonadError[F, E]) {

def ensure(error: => E)(predicate: A => Boolean): F[A] =
F.ensure(fa)(error)(predicate)

}
2 changes: 1 addition & 1 deletion core/src/main/scala/cats/syntax/monadFilter.scala
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package cats
package syntax

trait MonadFilterSyntax1 {
private[syntax] trait MonadFilterSyntax1 {
implicit def catsSyntaxUMonadFilter[FA](fa: FA)(implicit U: Unapply[MonadFilter, FA]): MonadFilter.Ops[U.M, U.A] =
new MonadFilter.Ops[U.M, U.A] {
val self = U.subst(fa)
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/scala/cats/syntax/reducible.scala
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package cats
package syntax

trait ReducibleSyntax1 {
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)
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/scala/cats/syntax/semigroupk.scala
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package cats
package syntax

trait SemigroupKSyntax1 {
private[syntax] trait SemigroupKSyntax1 {
// TODO: use simulacrum instances eventually
implicit def catsSyntaxUSemigroup[FA](fa: FA)(implicit U: Unapply[SemigroupK, FA]): SemigroupK.Ops[U.M, U.A] =
new SemigroupK.Ops[U.M, U.A] {
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/scala/cats/syntax/traverse.scala
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package cats
package syntax

trait TraverseSyntax1 {
private[syntax] trait TraverseSyntax1 {
implicit def catsSyntaxUTraverse[FA](fa: FA)(implicit U: Unapply[Traverse, FA]): TraverseOps[U.M, U.A] =
new TraverseOps(U.subst(fa))(U.TC)
}
Expand Down