diff --git a/build.sbt b/build.sbt index 4949babd99..41c6d9b0bb 100644 --- a/build.sbt +++ b/build.sbt @@ -266,7 +266,6 @@ def mimaSettings(moduleName: String) = { import com.typesafe.tools.mima.core.ProblemFilters._ //Only sealed abstract classes that provide implicit instances to companion objects are allowed here, since they don't affect usage outside of the file. Seq( - exclude[DirectMissingMethodProblem]("cats.data.OptionTInstances.catsDataMonadForOptionT"), exclude[DirectMissingMethodProblem]("cats.data.OptionTInstances2.catsDataTraverseForOptionT"), exclude[DirectMissingMethodProblem]("cats.data.KleisliInstances1.catsDataCommutativeArrowForKleisliId"), exclude[DirectMissingMethodProblem]("cats.data.OptionTInstances1.catsDataMonoidKForOptionT"), diff --git a/core/src/main/scala/cats/data/OptionT.scala b/core/src/main/scala/cats/data/OptionT.scala index 9cac0f5c2a..606bc5d252 100644 --- a/core/src/main/scala/cats/data/OptionT.scala +++ b/core/src/main/scala/cats/data/OptionT.scala @@ -217,6 +217,10 @@ object OptionT extends OptionTInstances { } private[data] sealed abstract class OptionTInstances extends OptionTInstances0 { + // to maintain binary compatibility + def catsDataMonadForOptionT[F[_]](implicit F0: Monad[F]): Monad[OptionT[F, ?]] = + new OptionTMonad[F] { implicit val F = F0 } + implicit def catsDataTraverseForOptionT[F[_]](implicit F0: Traverse[F]): Traverse[OptionT[F, ?]] = new OptionTTraverse[F] with OptionTFunctor[F] { implicit val F = F0 }