diff --git a/AUTHORS.md b/AUTHORS.md index 1535a2cfc4..8baa5ca9c1 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -19,6 +19,7 @@ possible: * Aldo Stracquadanio * Alejandro Gómez * Alessandro Lacava + * Alejandro Marín E. * Alexandru Nedelcu * Alexander Semenov * Alexey Levan @@ -37,9 +38,11 @@ possible: * Ben Hutchison * Benjamin Thuillier * Binh Nguyen + * Bjørn Madsen * Bobby Rauchenberg * Brendan McAdams * Brian McKenna + * Bryan Tan * Chris Birchall * Cody Allen * Colt Frederickson @@ -53,11 +56,13 @@ possible: * Dave Rostron * David Allsopp * David Gregory + * David R. Bild * Denis Mikhaylov * Denis * Derek Wickern * Diego Esteban Alonso Blas * Earl St Sauver + * Edd Steel * Eric Torreborre * Erik LaBianca * Erik Osheim @@ -67,12 +72,15 @@ possible: * Fabio Labella * Feynman Liang * Frank S. Thomas + * Gabriele Petronella * Giulio De Luise * Greg Pfeil * Guillaume Massé * Hamish Dickson + * Harrison Houghton * Ian McIntosh * ImLiar + * Ionuț G. Stan * Israel Pérez González * Itamar Ravid * Jan-Hendrik Zab @@ -88,6 +96,7 @@ possible: * Juan Pedro Moreno * Julien Richard-Foy * Julien Truffaut + * Jun Tomioka * Kailuo Wang * Kenji Yoshida * Leandro Bolivar @@ -107,6 +116,7 @@ possible: * Matthias Lüneberg * Max Worgan * Merlin Göttlinger + * Michael Ledin * Michael Pilquist * Mike Curry * Miles Sabin @@ -127,6 +137,8 @@ possible: * Rafa Paradela * Raúl Raja Martínez * RawToast + * Raymond Tay + * Richard Imaoka * Richard Miller * Rintcius Blok * Rob Norris @@ -136,6 +148,7 @@ possible: * Ryan Case * Sam Ritchie * Sarunas Valaskevicius + * Sho Kohara * Shohei Kamimori * Shunsuke Otani * Simeon H. K. Fitch @@ -143,12 +156,17 @@ possible: * Stephen Carman * Stephen Judkins * Stew O'Connor + * Suhas Gaddam * Sumedh Mungee * Takayuki Sakai * Taylor Brown * Tom Switzer * Tomas Mikula + * Tongfei Chen * Travis Brown + * Trond Bjerkestrand + * Tya + * ven * Vladimir Samoylov * Wedens * Xavier Fernández Salas @@ -156,6 +174,7 @@ possible: * Yilin Wei * Zach Abbott * zainab-ali + * Ziyang Liu Cats has been heavily inspired by many libraries, including [Scalaz](https://github.com/scalaz/scalaz), Haskell's [Prelude](https://hackage.haskell.org/package/base-4.9.0.0/docs/Prelude.html), and others. diff --git a/CHANGES.md b/CHANGES.md index eeacac628e..28b3bd4c88 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,3 +1,186 @@ +## Version 1.0.0-RC1 + +> 2017 Oct 21 + +This is the only planned release candidate release prior to 1.0.0. + +### Breaking changes and migration + +* [#1964](https://github.com/typelevel/cats/pull/1964) Require an `Order` instance for `NonEmptyList`'s groupBy function by @igstan +* [#1961](https://github.com/typelevel/cats/pull/1961) rename `Cartesian` to `Semigroupal` by @kailuowang +* [#1955](https://github.com/typelevel/cats/pull/1955) Deprecate `FlatMap`'s `>>` and `<<` by @LukaJCB +* [#1947](https://github.com/typelevel/cats/pull/1947) Rename `EitherT.liftT` to `EitherT.liftF` by @aeons +* [#1934](https://github.com/typelevel/cats/pull/1934) Restruct `functor` by @kailuowang +* [#1803](https://github.com/typelevel/cats/pull/1803) Convert `ReaderWriterStateT` to `IndexedReaderWriterStateT` by @iravid +* [#1775](https://github.com/typelevel/cats/pull/1775) Convert `StateT` to `IndexedStateT` by @iravid +* [#1098](https://github.com/typelevel/cats/pull/1098) Add a different `MonoidK` and `SemigroupK` instance for `Kleisli` by @peterneyens +* [#1922](https://github.com/typelevel/cats/pull/1922) Make kernel laws consistent with core laws by @LukaJCB +* [#1838](https://github.com/typelevel/cats/pull/1838) Sync `NonEmptyList` and `NonEmptyVector` methods by @durban +* [#1914](https://github.com/typelevel/cats/pull/1914) Add `Invariant` instances for kernel type classes by @LukaJCB +* [#1980](https://github.com/typelevel/cats/pull/1980) Make `iterateRight` in `Foldable` sound by @LukaJCB +* [#1972](https://github.com/typelevel/cats/pull/1972) Add `SortedMap` and `SortedSet` instances/Move `Set` and `Map` instances to Alleycats by @LukaJCB/@kailuowang +* [#1997](https://github.com/typelevel/cats/pull/1997) Minimizing typeclass surface in cats-kernel by @denisrosset +* [#1987](https://github.com/typelevel/cats/pull/1987) Add `mapK` to `transformers` by @andyscott / @LukaJCB + +To migrate from 1.0.0-MF. + +* The rename of `Cartesian` to `Semigroupal` and `EitherT.liftT` to `EitherT.liftF` can be done automatically through scalafix we provide. See instructions [here](https://github.com/typelevel/cats/blob/master/scalafix/README.md). +* For `FlatMap`'s `>>` and `<<`, use `Apply`'s `*>` and `<*` instead. +* `Profunctor` and `Strong` were moved to the `cats.arrow` package, `Bifunctor`, `Invariant` and `Contravariant` were moved to the `cats` root package. +* `SemigroupK[λ[α => Kleisli[F, α, α]]]` and `MonoidK[λ[α => Kleisli[F, α, α]]]` are no longer implicitly available, Use `Kleisli.endoSemigroupK` and `Kleisli.endoMonoidK` to get them explicitly. +* law testing for type classes in `cats.kernel` was made consistent with the law testing in `cats.core`. Check [here](https://typelevel.org/cats/typeclasses/lawtesting.html) for a guide on how to test cats type class instances. +* `NonEmptyList.concat` that takes `NonEmptlyList` was deprecated, use `NonEmptyList.concatNel` instead. +* `Monoid` no longer has a `InvariantMonoidal` instance, we discovered that it's not lawful. It has have an `Invariant` and a `Semigroupal` (new name for `Cartesian`) instance. +* `Foldable.iterateRight` now takes an `Iterable` instead of `Iterator`, see #1973 for rationale. +* `Foldable` for `Set` and `Traversable` for `Map` were moved to Alleycats, see #1831 for rationale. +* `cats.data.Kleisli#transform` and `cats.free.Coyoneda#transform` were deprecated and replaced by `mapK` + +### New features / enhancements (API, instances, data types, etc.): + +* [#1958](https://github.com/typelevel/cats/pull/1958) Add `FlatMap#flatTap`, a more principled version of the kestrel combinator. by @hrhino +* [#1950](https://github.com/typelevel/cats/pull/1950) more instances for `Hash` (#1712): `Queue`/`Duration` by @ctongfei +* [#1942](https://github.com/typelevel/cats/pull/1942) add `traverseN` to cartesian syntax by @julien-truffaut +* [#1939](https://github.com/typelevel/cats/pull/1939) Add `guard` to `Alternative` by @SystemFw +* [#1933](https://github.com/typelevel/cats/pull/1933) Add syntax for `ApplicativeError`.fromEither by @tpolecat +* [#1921](https://github.com/typelevel/cats/pull/1921) Optimize `FreeApplicative.product` by @peterneyens +* [#1910](https://github.com/typelevel/cats/pull/1910) Add `NonEmptyList.ofInitLast` by @eddsteel +* [#1888](https://github.com/typelevel/cats/pull/1888) Enhances stack safety for `Eval`. by @non +* [#1885](https://github.com/typelevel/cats/pull/1885) Add `zipWith` to `NonEmptyList` and `NonEmptyVector` by @LukaJCB +* [#1882](https://github.com/typelevel/cats/pull/1882) convert trait into abstract class for better bin compact by @kailuowang +* [#1878](https://github.com/typelevel/cats/pull/1878) Add some instances we were missing. by @non +* [#1858](https://github.com/typelevel/cats/pull/1858) Add `NonEmptyList#partitionE` by @LukaJCB +* [#1847](https://github.com/typelevel/cats/pull/1847) Add right and left functor to `BiFunctor` by @LukaJCB +* [#1840](https://github.com/typelevel/cats/pull/1840) Add `Foldable` and `Traversable` instances for `Free` by @aaronlevin +* [#1819](https://github.com/typelevel/cats/pull/1819) Added more implementations of `map2Eval` in progress by @johnynek +* [#1811](https://github.com/typelevel/cats/pull/1811) Move tuple `Cartesian` syntax implicit parameter by @DavidGregory084 +* [#1809](https://github.com/typelevel/cats/pull/1809) Add iterateWhileM and iterateUntilM by @drbild +* [#1790](https://github.com/typelevel/cats/pull/1790) Implement EitherT#leftFlatMap and EitherT#leftSemiflatMap by @vendethiel +* [#1784](https://github.com/typelevel/cats/pull/1784) Add `existsM` and `forallM` to Foldable by @refried +* [#1712](https://github.com/typelevel/cats/pull/1712) Hash typeclass by @ctongfei +* [#1976](https://github.com/typelevel/cats/pull/1976) Reduced usage of `fold` in `Validated` for better performance by @kailuowang +* [#1967](https://github.com/typelevel/cats/pull/1967) Add a few type classes to generated tuple instances by @edmundnoble/@kailuowang +* [#1984](https://github.com/typelevel/cats/pull/1984) Welcome, Alleycats by @kailuowang +* [#1927](https://github.com/typelevel/cats/pull/1927) Add `CommutativeApply` and `CommutativeApplicative` by @LukaJCB +* [#1837](https://github.com/typelevel/cats/pull/1837) Add `Parallel` type class by @LukaJCB +* [#1998](https://github.com/typelevel/cats/pull/1998) Add `Validated.cond` and `Validated.condNel` by @andyscott + + +### Bug fixes: + +* [#1917](https://github.com/typelevel/cats/pull/1917) Don't use package object convention for object source path by @travisbrown +* [#1804](https://github.com/typelevel/cats/pull/1804) workaround for a possible scala bug in show for value class by @kailuowang +* [#1980](https://github.com/typelevel/cats/pull/1980) Make `iterateRight` in `Foldable` sound by @LukaJCB + +### Documentation Improvements/Additions: + +* [#1970](https://github.com/typelevel/cats/pull/1970) Add docs for `StateT` and `IndexedStateT` by @iravid +* [#1956](https://github.com/typelevel/cats/pull/1956) Mention the right issue number of doom. by @hrhino +* [#1952](https://github.com/typelevel/cats/pull/1952) Added examples of `Arrow` composition by @raymondtay +* [#1946](https://github.com/typelevel/cats/pull/1946) Give higher priority to partial-unification fix by @LukaJCB +* [#1944](https://github.com/typelevel/cats/pull/1944) Fix typo. by @jooohn +* [#1924](https://github.com/typelevel/cats/pull/1924) Add docs for Arrow by @zliu41 +* [#1923](https://github.com/typelevel/cats/pull/1923) Update footer by @kailuowang +* [#1920](https://github.com/typelevel/cats/pull/1920) Document naming implicits according to @non s comment in #1061 by @tbje +* [#1916](https://github.com/typelevel/cats/pull/1916) Fix tiny extra vowel typo by @andyscott +* [#1915](https://github.com/typelevel/cats/pull/1915) Consolidate readme.md and index.md by @kailuowang +* [#1913](https://github.com/typelevel/cats/pull/1913) updated footer by @kailuowang +* [#1905](https://github.com/typelevel/cats/pull/1905) s/rewrites/rules and update scalafix version in the README by @gabro +* [#1903](https://github.com/typelevel/cats/pull/1903) `Validated` beginners doc by @AlejandroME +* [#1901](https://github.com/typelevel/cats/pull/1901) added FAQ item diff between cats and scalaz by @kailuowang +* [#1900](https://github.com/typelevel/cats/pull/1900) add newts to related projects by @kailuowang +* [#1899](https://github.com/typelevel/cats/pull/1899) Fix symbol signature for right and left apply in faq.md by @suhasgaddam +* [#1897](https://github.com/typelevel/cats/pull/1897) add bin compat goal by @kailuowang +* [#1895](https://github.com/typelevel/cats/pull/1895) trying to fix contributing page by @kailuowang +* [#1894](https://github.com/typelevel/cats/pull/1894) Fix typo in background image of homepage. by @Ttcao +* [#1890](https://github.com/typelevel/cats/pull/1890) Doc: Correct the URL of cats-mtl to the typelevel repository by @richardimaoka +* [#1884](https://github.com/typelevel/cats/pull/1884) Rename typeclass => type class in Readme.md by @LukaJCB +* [#1880](https://github.com/typelevel/cats/pull/1880) Add law testing guide by @LukaJCB +* [#1875](https://github.com/typelevel/cats/pull/1875) Fix typo in `SemigroupK` scaladoc by @LukaJCB +* [#1874](https://github.com/typelevel/cats/pull/1874) Fix typo in `WriterT` tests by @LukaJCB +* [#1873](https://github.com/typelevel/cats/pull/1873) Add pureconfig and finch to ecosystem project list by @kailuowang +* [#1872](https://github.com/typelevel/cats/pull/1872) Fix couple of typos in CHANGES.md by @LukaJCB +* [#1871](https://github.com/typelevel/cats/pull/1871) Fix typo in `Traverse#traverseWithIndexM` by @LukaJCB +* [#1857](https://github.com/typelevel/cats/pull/1857) Fix typo (Foldabale => Foldable) by @LukaJCB +* [#1856](https://github.com/typelevel/cats/pull/1856) Remove mtl classes from menu by @LukaJCB +* [#1854](https://github.com/typelevel/cats/pull/1854) Add EitherT docs by @Technius +* [#1846](https://github.com/typelevel/cats/pull/1846) Add `grafter` to the list of Typelevel projects using cats by @etorreborre +* [#1845](https://github.com/typelevel/cats/pull/1845) Adding the origami project to the list of Typelevel projects using cats by @etorreborre +* [#1827](https://github.com/typelevel/cats/pull/1827) add trailing slashes to URLs by @larsrh +* [#1822](https://github.com/typelevel/cats/pull/1822) Add docs for `Ior` by @LukaJCB +* [#1820](https://github.com/typelevel/cats/pull/1820) Fix links by @n4to4 +* [#1817](https://github.com/typelevel/cats/pull/1817) Add seals to related projects by @durban +* [#1816](https://github.com/typelevel/cats/pull/1816) Add `Eval` documentation by @LukaJCB +* [#1814](https://github.com/typelevel/cats/pull/1814) remove outdated TODOs by @kailuowang +* [#1808](https://github.com/typelevel/cats/pull/1808) minor link change by @kailuowang +* [#1806](https://github.com/typelevel/cats/pull/1806) add notes to cartesian migration by @kailuowang +* [#1799](https://github.com/typelevel/cats/pull/1799) add decline to project list by @kailuowang +* [#1796](https://github.com/typelevel/cats/pull/1796) add `Foldable.existsM/forallM` to docs by @refried +* [#1792](https://github.com/typelevel/cats/pull/1792) Add size control for typeclass diagram by @LukaJCB +* [#1789](https://github.com/typelevel/cats/pull/1789) Add documentation for `Show` by @LukaJCB +* [#1788](https://github.com/typelevel/cats/pull/1788) Add `Eq` docs by @LukaJCB +* [#1787](https://github.com/typelevel/cats/pull/1787) Add `NonEmptyTraverse` docs by @LukaJCB +* [#1781](https://github.com/typelevel/cats/pull/1781) promoting the ecosystem in readme a bit and fixed a typo by @kailuowang +* [#1779](https://github.com/typelevel/cats/pull/1779) quick date fix by @kailuowang +* [#1756](https://github.com/typelevel/cats/pull/1756) Add piecemeal import guide by @LukaJCB +* [#1777](https://github.com/typelevel/cats/pull/1777) Add `Reducible` docs by @LukaJCB +* [#1985](https://github.com/typelevel/cats/pull/1985) Links "LawTesting.md" in FAQ and TypeClasses pages by @AlejandroME +* [#1993](https://github.com/typelevel/cats/pull/1993) Added examples for `Cokleisli` by @raymondtay + +### Build improvements/dependency updates + +* [#1948](https://github.com/typelevel/cats/pull/1948) Update scalafix project dependencies by @aeons +* [#1926](https://github.com/typelevel/cats/pull/1926) Update coursier to version 1.0.0-RC12 by @mxl +* [#1925](https://github.com/typelevel/cats/pull/1925) temporarily disable MiMa check on kernel by @kailuowang +* [#1918](https://github.com/typelevel/cats/pull/1918) Update sbt-microsites to 0.7.0 by @LukaJCB +* [#1902](https://github.com/typelevel/cats/pull/1902) Upgrade Scalafix to 0.5.0-RC2 by @gabro +* [#1898](https://github.com/typelevel/cats/pull/1898) Update various sbt plugins by @fthomas +* [#1892](https://github.com/typelevel/cats/pull/1892) Remove deprecated requiresDOM setting by @fthomas +* [#1889](https://github.com/typelevel/cats/pull/1889) Add val for "compile-time" sbt Configuration by @fthomas +* [#1887](https://github.com/typelevel/cats/pull/1887) Update sbt-pgp to 1.1.0 by @fthomas +* [#1886](https://github.com/typelevel/cats/pull/1886) Update Scala.js to 0.6.20 by @fthomas +* [#1876](https://github.com/typelevel/cats/pull/1876) build: use curly braces for disabling tasks by @fthomas +* [#1868](https://github.com/typelevel/cats/pull/1868) Update sbt-microsites to 0.6.1 by @BennyHill +* [#1866](https://github.com/typelevel/cats/pull/1866) Revert scalatest to 3.0.3 by @BennyHill +* [#1865](https://github.com/typelevel/cats/pull/1865) Set simulacrum version to 0.11.0 by @BennyHill +* [#1864](https://github.com/typelevel/cats/pull/1864) Set scalaz version to 7.2.15 by @BennyHill +* [#1862](https://github.com/typelevel/cats/pull/1862) Bump kind-projector version to 0.9.4 by @shokohara +* [#1861](https://github.com/typelevel/cats/pull/1861) Update sbt-scoverage to 1.5.1 by @fthomas +* [#1860](https://github.com/typelevel/cats/pull/1860) Update sbt-pgp to 1.1.0-M1 by @LukaJCB +* [#1859](https://github.com/typelevel/cats/pull/1859) Update sbt-sonatype by @LukaJCB +* [#1852](https://github.com/typelevel/cats/pull/1852) Remove sbt-ghpages because it is pulled in by sbt-microsites by @fthomas +* [#1849](https://github.com/typelevel/cats/pull/1849) Update sbt-git to 0.9.3 by @fthomas +* [#1844](https://github.com/typelevel/cats/pull/1844) Replace botBuild with sbt-travisci's isTravisBuild by @fthomas +* [#1843](https://github.com/typelevel/cats/pull/1843) Update sbt-unidoc to 0.4.1 by @fthomas +* [#1842](https://github.com/typelevel/cats/pull/1842) Update partial-unification plugin to 1.1.0 by @fthomas +* [#1839](https://github.com/typelevel/cats/pull/1839) Update scalastyle-sbt-plugin to 1.0.0 by @fthomas +* [#1829](https://github.com/typelevel/cats/pull/1829) Update sbt-release to 1.0.6 by @fthomas +* [#1828](https://github.com/typelevel/cats/pull/1828) Update sbt-jmh to 0.2.27 by @fthomas +* [#1826](https://github.com/typelevel/cats/pull/1826) Pass sbt settings without varargs expansion by @fthomas +* [#1825](https://github.com/typelevel/cats/pull/1825) Update sbt-coursier to 1.0.0-RC10 by @fthomas +* [#1824](https://github.com/typelevel/cats/pull/1824) Update sbt-mima-plugin to 0.1.17 by @fthomas +* [#1821](https://github.com/typelevel/cats/pull/1821) Update sbt-doctest to 0.7.0 by @fthomas +* [#1795](https://github.com/typelevel/cats/pull/1795) Bump discipline version to 0.8 by @shokohara +* [#1793](https://github.com/typelevel/cats/pull/1793) Add Scalafix rewrites for 1.0.0 by @gabro +* [#1782](https://github.com/typelevel/cats/pull/1782) Bump scalacheck version to 1.13.5 by @shokohara +* [#1780](https://github.com/typelevel/cats/pull/1780) Bump machinist version to 0.6.2 by @shokohara +* [#1778](https://github.com/typelevel/cats/pull/1778) Bump sbt version to 0.13.16 by @shokohara + +### Testing improvements + +* [#1963](https://github.com/typelevel/cats/pull/1963) Move `followedBy`/`forEffect` tests to `ApplyTests` by @peterneyens +* [#1960](https://github.com/typelevel/cats/pull/1960) Harmonize naming of discipline test classes in cats-kernel-laws. by @denisrosset +* [#1953](https://github.com/typelevel/cats/pull/1953) Add a more direct tailRecM law. by @johnynek +* [#1906](https://github.com/typelevel/cats/pull/1906) Fix `Alternative` law checking for `IndexedStateT`. by @iravid +* [#1975](https://github.com/typelevel/cats/pull/1975) Unifies test naming standard. by @AlejandroME +* [#1999](https://github.com/typelevel/cats/pull/1999) Fix order of comparison for `EitherT.cond`. by @andyscott + +### Scalafix for migration + +* [#1813](https://github.com/typelevel/cats/pull/1813) Add `RenameInjectProdAndCoproduct`, `RenameTupleApplySyntax` and `RemoveSplit` Scalafix rewrites by @gabro +* [#1937](https://github.com/typelevel/cats/pull/1937) Add scalafix for `contramap` by @LukaJCB + + + ## Version 1.0.0-MF > 2017 Aug 3 diff --git a/README.md b/README.md index f6b8b72c6a..181899cfcd 100644 --- a/README.md +++ b/README.md @@ -39,7 +39,7 @@ addSbtPlugin("org.lyranthe.sbt" % "partial-unification" % "1.1.0") And then create the cats dependency, by adding the following to your `build.sbt`: ```scala -libraryDependencies += "org.typelevel" %% "cats-core" % "1.0.0-MF" +libraryDependencies += "org.typelevel" %% "cats-core" % "1.0.0-RC1" ``` This will pull in the cats-core module. If you require some other @@ -52,13 +52,13 @@ functionality, you can pick-and-choose from amongst these modules * `cats-laws`: Laws for testing type class instances. * `cats-free`: Free structures such as the free monad, and supporting type classes. * `cats-testkit`: lib for writing tests for type class instances using laws. + * `alleycats-core`: cats instances and classes which are not lawful. There are several other cats modules that are in separate repos so that they can maintain independent release cycles. * [`cats-effect`](https://github.com/typelevel/cats-effect): standard `IO` type together with `Sync`, `Async` and `Effect` type classes * [`cats-mtl`](https://github.com/typelevel/cats-mtl): transformer typeclasses for cats' Monads, Applicatives and Functors. - * [`alleycats`](https://github.com/non/alleycats): cats instances and classes which are not lawful. * [`mouse`](https://github.com/typelevel/mouse): a small companion to cats that provides convenient syntax (aka extension methods) diff --git a/build.sbt b/build.sbt index e941115b79..9ed50b92be 100644 --- a/build.sbt +++ b/build.sbt @@ -185,6 +185,18 @@ lazy val docSettings = Seq( includeFilter in Jekyll := (includeFilter in makeSite).value ) +lazy val binaryCompatibleVersion = "1.0.0-RC1" + +def mimaSettings(moduleName: String) = Seq( + mimaPreviousArtifacts := Set("org.typelevel" %% moduleName % binaryCompatibleVersion), + // TODO: remove this post-release of 1.0.0 + mimaBinaryIssueFilters += { + import com.typesafe.tools.mima.core._ + import com.typesafe.tools.mima.core.ProblemFilters._ + exclude[ReversedMissingMethodProblem]("cats.syntax.FoldableSyntax.catsSyntaxFoldOps") + } +) + lazy val docs = project .enablePlugins(MicrositesPlugin) .enablePlugins(ScalaUnidocPlugin) @@ -231,380 +243,6 @@ lazy val macros = crossProject.crossType(CrossType.Pure) lazy val macrosJVM = macros.jvm lazy val macrosJS = macros.js -val binaryCompatibleVersion = "0.8.0" - -val binaryCompatibleExceptions = { - import com.typesafe.tools.mima.core._ - import com.typesafe.tools.mima.core.ProblemFilters._ - Seq( // todo: remove these once we release 1.0.0-RC1 - exclude[UpdateForwarderBodyProblem]("cats.kernel.instances.TupleInstances.catsKernelStdBandForTuple5"), - exclude[UpdateForwarderBodyProblem]("cats.kernel.instances.TupleInstances.catsKernelStdSemigroupForTuple3"), - exclude[UpdateForwarderBodyProblem]("cats.kernel.instances.TupleInstances.catsKernelStdSemilatticeForTuple5"), - exclude[UpdateForwarderBodyProblem]("cats.kernel.instances.TupleInstances.catsKernelStdGroupForTuple2"), - exclude[UpdateForwarderBodyProblem]("cats.kernel.instances.TupleInstances.catsKernelStdMonoidForTuple2"), - exclude[UpdateForwarderBodyProblem]("cats.kernel.instances.TupleInstances.catsKernelStdBandForTuple20"), - exclude[UpdateForwarderBodyProblem]("cats.kernel.instances.TupleInstances.catsKernelStdSemilatticeForTuple18"), - exclude[UpdateForwarderBodyProblem]("cats.kernel.instances.TupleInstances.catsKernelStdMonoidForTuple13"), - exclude[UpdateForwarderBodyProblem]("cats.kernel.instances.TupleInstances.catsKernelStdSemigroupForTuple17"), - exclude[UpdateForwarderBodyProblem]("cats.kernel.instances.TupleInstances.catsKernelStdBandForTuple14"), - exclude[UpdateForwarderBodyProblem]("cats.kernel.instances.TupleInstances.catsKernelStdSemigroupForTuple6"), - exclude[UpdateForwarderBodyProblem]("cats.kernel.instances.TupleInstances.catsKernelStdGroupForTuple13"), - exclude[UpdateForwarderBodyProblem]("cats.kernel.instances.TupleInstances.catsKernelStdSemigroupForTuple11"), - exclude[UpdateForwarderBodyProblem]("cats.kernel.instances.TupleInstances.catsKernelStdBandForTuple17"), - exclude[UpdateForwarderBodyProblem]("cats.kernel.instances.TupleInstances.catsKernelStdMonoidForTuple16"), - exclude[UpdateForwarderBodyProblem]("cats.kernel.instances.TupleInstances.catsKernelStdSemilatticeForTuple8"), - exclude[UpdateForwarderBodyProblem]("cats.kernel.instances.TupleInstances.catsKernelStdSemilatticeForTuple12"), - exclude[UpdateForwarderBodyProblem]("cats.kernel.instances.TupleInstances.catsKernelStdSemilatticeForTuple21"), - exclude[UpdateForwarderBodyProblem]("cats.kernel.instances.TupleInstances.catsKernelStdGroupForTuple16"), - exclude[UpdateForwarderBodyProblem]("cats.kernel.instances.TupleInstances.catsKernelStdSemigroupForTuple20"), - exclude[UpdateForwarderBodyProblem]("cats.kernel.instances.TupleInstances.catsKernelStdSemigroupForTuple14"), - exclude[UpdateForwarderBodyProblem]("cats.kernel.instances.TupleInstances.catsKernelStdGroupForTuple22"), - exclude[UpdateForwarderBodyProblem]("cats.kernel.instances.TupleInstances.catsKernelStdBandForTuple11"), - exclude[UpdateForwarderBodyProblem]("cats.kernel.instances.TupleInstances.catsKernelStdSemilatticeForTuple15"), - exclude[UpdateForwarderBodyProblem]("cats.kernel.instances.TupleInstances.catsKernelStdSemigroupForTuple9"), - exclude[UpdateForwarderBodyProblem]("cats.kernel.instances.TupleInstances.catsKernelStdGroupForTuple10"), - exclude[UpdateForwarderBodyProblem]("cats.kernel.instances.TupleInstances.catsKernelStdGroupForTuple1"), - exclude[UpdateForwarderBodyProblem]("cats.kernel.instances.TupleInstances.catsKernelStdBandForTuple4"), - exclude[UpdateForwarderBodyProblem]("cats.kernel.instances.TupleInstances.catsKernelStdGroupForTuple19"), - exclude[UpdateForwarderBodyProblem]("cats.kernel.instances.TupleInstances.catsKernelStdMonoidForTuple4"), - exclude[UpdateForwarderBodyProblem]("cats.kernel.instances.TupleInstances.catsKernelStdMonoidForTuple21"), - exclude[UpdateForwarderBodyProblem]("cats.kernel.instances.TupleInstances.catsKernelStdGroupForTuple4"), - exclude[UpdateForwarderBodyProblem]("cats.kernel.instances.TupleInstances.catsKernelStdMonoidForTuple15"), - exclude[UpdateForwarderBodyProblem]("cats.kernel.instances.TupleInstances.catsKernelStdBandForTuple7"), - exclude[UpdateForwarderBodyProblem]("cats.kernel.instances.TupleInstances.catsKernelStdSemilatticeForTuple7"), - exclude[UpdateForwarderBodyProblem]("cats.kernel.instances.TupleInstances.catsKernelStdBandForTuple1"), - exclude[UpdateForwarderBodyProblem]("cats.kernel.instances.TupleInstances.catsKernelStdSemilatticeForTuple20"), - exclude[UpdateForwarderBodyProblem]("cats.kernel.instances.TupleInstances.catsKernelStdGroupForTuple7"), - exclude[UpdateForwarderBodyProblem]("cats.kernel.instances.TupleInstances.catsKernelStdSemilatticeForTuple1"), - exclude[UpdateForwarderBodyProblem]("cats.kernel.instances.TupleInstances.catsKernelStdSemigroupForTuple13"), - exclude[UpdateForwarderBodyProblem]("cats.kernel.instances.TupleInstances.catsKernelStdMonoidForTuple18"), - exclude[UpdateForwarderBodyProblem]("cats.kernel.instances.TupleInstances.catsKernelStdSemigroupForTuple8"), - exclude[UpdateForwarderBodyProblem]("cats.kernel.instances.TupleInstances.catsKernelStdMonoidForTuple7"), - exclude[UpdateForwarderBodyProblem]("cats.kernel.instances.TupleInstances.catsKernelStdSemigroupForTuple22"), - exclude[UpdateForwarderBodyProblem]("cats.kernel.instances.TupleInstances.catsKernelStdGroupForTuple18"), - exclude[UpdateForwarderBodyProblem]("cats.kernel.instances.TupleInstances.catsKernelStdSemigroupForTuple2"), - exclude[UpdateForwarderBodyProblem]("cats.kernel.instances.TupleInstances.catsKernelStdSemilatticeForTuple4"), - exclude[UpdateForwarderBodyProblem]("cats.kernel.instances.TupleInstances.catsKernelStdSemilatticeForTuple17"), - exclude[UpdateForwarderBodyProblem]("cats.kernel.instances.TupleInstances.catsKernelStdBandForTuple13"), - exclude[UpdateForwarderBodyProblem]("cats.kernel.instances.TupleInstances.catsKernelStdSemigroupForTuple16"), - exclude[UpdateForwarderBodyProblem]("cats.kernel.instances.TupleInstances.catsKernelStdMonoidForTuple1"), - exclude[UpdateForwarderBodyProblem]("cats.kernel.instances.TupleInstances.catsKernelStdMonoidForTuple12"), - exclude[UpdateForwarderBodyProblem]("cats.kernel.instances.TupleInstances.catsKernelStdSemigroupForTuple10"), - exclude[UpdateForwarderBodyProblem]("cats.kernel.instances.TupleInstances.catsKernelStdGroupForTuple12"), - exclude[UpdateForwarderBodyProblem]("cats.kernel.instances.TupleInstances.catsKernelStdBandForTuple22"), - exclude[UpdateForwarderBodyProblem]("cats.kernel.instances.TupleInstances.catsKernelStdSemigroupForTuple19"), - exclude[UpdateForwarderBodyProblem]("cats.kernel.instances.TupleInstances.catsKernelStdBandForTuple16"), - exclude[UpdateForwarderBodyProblem]("cats.kernel.instances.TupleInstances.catsKernelStdSemilatticeForTuple11"), - exclude[UpdateForwarderBodyProblem]("cats.kernel.instances.TupleInstances.catsKernelStdSemigroupForTuple5"), - exclude[UpdateForwarderBodyProblem]("cats.kernel.instances.TupleInstances.catsKernelStdGroupForTuple15"), - exclude[UpdateForwarderBodyProblem]("cats.kernel.instances.TupleInstances.catsKernelStdGroupForTuple21"), - exclude[UpdateForwarderBodyProblem]("cats.kernel.instances.TupleInstances.catsKernelStdSemilatticeForTuple14"), - exclude[UpdateForwarderBodyProblem]("cats.kernel.instances.TupleInstances.catsKernelStdBandForTuple19"), - exclude[UpdateForwarderBodyProblem]("cats.kernel.instances.TupleInstances.catsKernelStdBandForTuple10"), - exclude[UpdateForwarderBodyProblem]("cats.kernel.instances.TupleInstances.catsKernelStdBandForTuple3"), - exclude[UpdateForwarderBodyProblem]("cats.kernel.instances.TupleInstances.catsKernelStdGroupForTuple9"), - exclude[UpdateForwarderBodyProblem]("cats.kernel.instances.TupleInstances.catsKernelStdMonoidForTuple9"), - exclude[UpdateForwarderBodyProblem]("cats.kernel.instances.TupleInstances.catsKernelStdMonoidForTuple11"), - exclude[UpdateForwarderBodyProblem]("cats.kernel.instances.TupleInstances.catsKernelStdMonoidForTuple3"), - exclude[UpdateForwarderBodyProblem]("cats.kernel.instances.TupleInstances.catsKernelStdBandForTuple6"), - exclude[UpdateForwarderBodyProblem]("cats.kernel.instances.TupleInstances.catsKernelStdSemilatticeForTuple6"), - exclude[UpdateForwarderBodyProblem]("cats.kernel.instances.TupleInstances.catsKernelStdGroupForTuple3"), - exclude[UpdateForwarderBodyProblem]("cats.kernel.instances.TupleInstances.catsKernelStdMonoidForTuple20"), - exclude[UpdateForwarderBodyProblem]("cats.kernel.instances.TupleInstances.catsKernelStdMonoidForTuple14"), - exclude[UpdateForwarderBodyProblem]("cats.kernel.instances.TupleInstances.catsKernelStdSemigroupForTuple7"), - exclude[UpdateForwarderBodyProblem]("cats.kernel.instances.TupleInstances.catsKernelStdGroupForTuple6"), - exclude[UpdateForwarderBodyProblem]("cats.kernel.instances.TupleInstances.catsKernelStdSemilatticeForTuple13"), - exclude[UpdateForwarderBodyProblem]("cats.kernel.instances.TupleInstances.catsKernelStdSemilatticeForTuple9"), - exclude[UpdateForwarderBodyProblem]("cats.kernel.instances.TupleInstances.catsKernelStdSemigroupForTuple12"), - exclude[UpdateForwarderBodyProblem]("cats.kernel.instances.TupleInstances.catsKernelStdGroupForTuple20"), - exclude[UpdateForwarderBodyProblem]("cats.kernel.instances.TupleInstances.catsKernelStdMonoidForTuple6"), - exclude[UpdateForwarderBodyProblem]("cats.kernel.instances.TupleInstances.catsKernelStdMonoidForTuple17"), - exclude[UpdateForwarderBodyProblem]("cats.kernel.instances.TupleInstances.catsKernelStdBandForTuple9"), - exclude[UpdateForwarderBodyProblem]("cats.kernel.instances.TupleInstances.catsKernelStdGroupForTuple14"), - exclude[UpdateForwarderBodyProblem]("cats.kernel.instances.TupleInstances.catsKernelStdBandForTuple18"), - exclude[UpdateForwarderBodyProblem]("cats.kernel.instances.TupleInstances.catsKernelStdSemigroupForTuple15"), - exclude[UpdateForwarderBodyProblem]("cats.kernel.instances.TupleInstances.catsKernelStdSemigroupForTuple21"), - exclude[UpdateForwarderBodyProblem]("cats.kernel.instances.TupleInstances.catsKernelStdGroupForTuple17"), - exclude[UpdateForwarderBodyProblem]("cats.kernel.instances.TupleInstances.catsKernelStdSemigroupForTuple1"), - exclude[UpdateForwarderBodyProblem]("cats.kernel.instances.TupleInstances.catsKernelStdBandForTuple12"), - exclude[UpdateForwarderBodyProblem]("cats.kernel.instances.TupleInstances.catsKernelStdSemilatticeForTuple16"), - exclude[UpdateForwarderBodyProblem]("cats.kernel.instances.TupleInstances.catsKernelStdSemilatticeForTuple22"), - exclude[UpdateForwarderBodyProblem]("cats.kernel.instances.TupleInstances.catsKernelStdSemilatticeForTuple3"), - exclude[UpdateForwarderBodyProblem]("cats.kernel.instances.TupleInstances.catsKernelStdSemilatticeForTuple10"), - exclude[UpdateForwarderBodyProblem]("cats.kernel.instances.TupleInstances.catsKernelStdSemilatticeForTuple19"), - exclude[UpdateForwarderBodyProblem]("cats.kernel.instances.TupleInstances.catsKernelStdGroupForTuple11"), - exclude[UpdateForwarderBodyProblem]("cats.kernel.instances.TupleInstances.catsKernelStdSemigroupForTuple18"), - exclude[UpdateForwarderBodyProblem]("cats.kernel.instances.TupleInstances.catsKernelStdBandForTuple21"), - exclude[UpdateForwarderBodyProblem]("cats.kernel.instances.TupleInstances.catsKernelStdSemigroupForTuple4"), - exclude[UpdateForwarderBodyProblem]("cats.kernel.instances.TupleInstances.catsKernelStdBandForTuple15"), - exclude[UpdateForwarderBodyProblem]("cats.kernel.instances.TupleInstances.catsKernelStdBandForTuple8"), - exclude[UpdateForwarderBodyProblem]("cats.kernel.instances.TupleInstances.catsKernelStdGroupForTuple5"), - exclude[UpdateForwarderBodyProblem]("cats.kernel.instances.TupleInstances.catsKernelStdMonoidForTuple22"), - exclude[UpdateForwarderBodyProblem]("cats.kernel.instances.TupleInstances.catsKernelStdMonoidForTuple5"), - exclude[UpdateForwarderBodyProblem]("cats.kernel.instances.TupleInstances.catsKernelStdGroupForTuple8"), - exclude[UpdateForwarderBodyProblem]("cats.kernel.instances.TupleInstances.catsKernelStdMonoidForTuple8"), - exclude[UpdateForwarderBodyProblem]("cats.kernel.instances.TupleInstances.catsKernelStdSemilatticeForTuple2"), - exclude[UpdateForwarderBodyProblem]("cats.kernel.instances.TupleInstances.catsKernelStdBandForTuple2"), - exclude[UpdateForwarderBodyProblem]("cats.kernel.instances.TupleInstances.catsKernelStdMonoidForTuple19"), - exclude[UpdateForwarderBodyProblem]("cats.kernel.instances.TupleInstances.catsKernelStdMonoidForTuple10"), - exclude[ReversedMissingMethodProblem]("cats.kernel.instances.TupleInstances.catsKernelStdBoundedSemilatticeForTuple19"), - exclude[ReversedMissingMethodProblem]("cats.kernel.instances.TupleInstances.catsKernelStdBoundedSemilatticeForTuple1"), - exclude[ReversedMissingMethodProblem]("cats.kernel.instances.TupleInstances.catsKernelStdBoundedSemilatticeForTuple10"), - exclude[ReversedMissingMethodProblem]("cats.kernel.instances.TupleInstances.catsKernelStdCommutativeGroupForTuple11"), - exclude[ReversedMissingMethodProblem]("cats.kernel.instances.TupleInstances.catsKernelStdCommutativeGroupForTuple20"), - exclude[ReversedMissingMethodProblem]("cats.kernel.instances.TupleInstances.catsKernelStdCommutativeGroupForTuple14"), - exclude[ReversedMissingMethodProblem]("cats.kernel.instances.TupleInstances.catsKernelStdBoundedSemilatticeForTuple4"), - exclude[ReversedMissingMethodProblem]("cats.kernel.instances.TupleInstances.catsKernelStdBoundedSemilatticeForTuple13"), - exclude[ReversedMissingMethodProblem]("cats.kernel.instances.TupleInstances.catsKernelStdCommutativeGroupForTuple2"), - exclude[ReversedMissingMethodProblem]("cats.kernel.instances.TupleInstances.catsKernelStdCommutativeGroupForTuple5"), - exclude[ReversedMissingMethodProblem]("cats.kernel.instances.TupleInstances.catsKernelStdCommutativeGroupForTuple8"), - exclude[ReversedMissingMethodProblem]("cats.kernel.instances.TupleInstances.catsKernelStdBoundedSemilatticeForTuple3"), - exclude[ReversedMissingMethodProblem]("cats.kernel.instances.TupleInstances.catsKernelStdBoundedSemilatticeForTuple15"), - exclude[ReversedMissingMethodProblem]("cats.kernel.instances.TupleInstances.catsKernelStdBoundedSemilatticeForTuple21"), - exclude[ReversedMissingMethodProblem]("cats.kernel.instances.TupleInstances.catsKernelStdCommutativeGroupForTuple16"), - exclude[ReversedMissingMethodProblem]("cats.kernel.instances.TupleInstances.catsKernelStdCommutativeGroupForTuple22"), - exclude[ReversedMissingMethodProblem]("cats.kernel.instances.TupleInstances.catsKernelStdBoundedSemilatticeForTuple6"), - exclude[ReversedMissingMethodProblem]("cats.kernel.instances.TupleInstances.catsKernelStdCommutativeGroupForTuple10"), - exclude[ReversedMissingMethodProblem]("cats.kernel.instances.TupleInstances.catsKernelStdCommutativeGroupForTuple19"), - exclude[ReversedMissingMethodProblem]("cats.kernel.instances.TupleInstances.catsKernelStdBoundedSemilatticeForTuple18"), - exclude[ReversedMissingMethodProblem]("cats.kernel.instances.TupleInstances.catsKernelStdBoundedSemilatticeForTuple9"), - exclude[ReversedMissingMethodProblem]("cats.kernel.instances.TupleInstances.catsKernelStdCommutativeGroupForTuple13"), - exclude[ReversedMissingMethodProblem]("cats.kernel.instances.TupleInstances.catsKernelStdBoundedSemilatticeForTuple12"), - exclude[ReversedMissingMethodProblem]("cats.kernel.instances.TupleInstances.catsKernelStdCommutativeGroupForTuple1"), - exclude[ReversedMissingMethodProblem]("cats.kernel.instances.TupleInstances.catsKernelStdCommutativeGroupForTuple4"), - exclude[ReversedMissingMethodProblem]("cats.kernel.instances.TupleInstances.catsKernelStdBoundedSemilatticeForTuple8"), - exclude[ReversedMissingMethodProblem]("cats.kernel.instances.TupleInstances.catsKernelStdBoundedSemilatticeForTuple11"), - exclude[ReversedMissingMethodProblem]("cats.kernel.instances.TupleInstances.catsKernelStdCommutativeGroupForTuple7"), - exclude[ReversedMissingMethodProblem]("cats.kernel.instances.TupleInstances.catsKernelStdCommutativeGroupForTuple12"), - exclude[ReversedMissingMethodProblem]("cats.kernel.instances.TupleInstances.catsKernelStdBoundedSemilatticeForTuple2"), - exclude[ReversedMissingMethodProblem]("cats.kernel.instances.TupleInstances.catsKernelStdBoundedSemilatticeForTuple5"), - exclude[ReversedMissingMethodProblem]("cats.kernel.instances.TupleInstances.catsKernelStdBoundedSemilatticeForTuple14"), - exclude[ReversedMissingMethodProblem]("cats.kernel.instances.TupleInstances.catsKernelStdBoundedSemilatticeForTuple20"), - exclude[ReversedMissingMethodProblem]("cats.kernel.instances.TupleInstances.catsKernelStdCommutativeGroupForTuple15"), - exclude[ReversedMissingMethodProblem]("cats.kernel.instances.TupleInstances.catsKernelStdCommutativeGroupForTuple21"), - exclude[ReversedMissingMethodProblem]("cats.kernel.instances.TupleInstances.catsKernelStdCommutativeGroupForTuple18"), - exclude[ReversedMissingMethodProblem]("cats.kernel.instances.TupleInstances.catsKernelStdBoundedSemilatticeForTuple17"), - exclude[ReversedMissingMethodProblem]("cats.kernel.instances.TupleInstances.catsKernelStdCommutativeGroupForTuple6"), - exclude[ReversedMissingMethodProblem]("cats.kernel.instances.TupleInstances.catsKernelStdCommutativeGroupForTuple9"), - exclude[ReversedMissingMethodProblem]("cats.kernel.instances.TupleInstances.catsKernelStdBoundedSemilatticeForTuple22"), - exclude[ReversedMissingMethodProblem]("cats.kernel.instances.TupleInstances.catsKernelStdCommutativeGroupForTuple3"), - exclude[ReversedMissingMethodProblem]("cats.kernel.instances.TupleInstances.catsKernelStdCommutativeGroupForTuple17"), - exclude[ReversedMissingMethodProblem]("cats.kernel.instances.TupleInstances.catsKernelStdBoundedSemilatticeForTuple16"), - exclude[ReversedMissingMethodProblem]("cats.kernel.instances.TupleInstances.catsKernelStdBoundedSemilatticeForTuple7"), - exclude[InheritedNewAbstractMethodProblem]("cats.kernel.instances.TupleInstances1.catsKernelStdCommutativeMonoidForTuple18"), - exclude[InheritedNewAbstractMethodProblem]("cats.kernel.instances.TupleInstances1.catsKernelStdCommutativeMonoidForTuple8"), - exclude[InheritedNewAbstractMethodProblem]("cats.kernel.instances.TupleInstances1.catsKernelStdCommutativeMonoidForTuple17"), - exclude[InheritedNewAbstractMethodProblem]("cats.kernel.instances.TupleInstances1.catsKernelStdCommutativeMonoidForTuple2"), - exclude[InheritedNewAbstractMethodProblem]("cats.kernel.instances.TupleInstances1.catsKernelStdCommutativeMonoidForTuple11"), - exclude[InheritedNewAbstractMethodProblem]("cats.kernel.instances.TupleInstances1.catsKernelStdCommutativeMonoidForTuple5"), - exclude[InheritedNewAbstractMethodProblem]("cats.kernel.instances.TupleInstances1.catsKernelStdCommutativeMonoidForTuple14"), - exclude[InheritedNewAbstractMethodProblem]("cats.kernel.instances.TupleInstances1.catsKernelStdCommutativeMonoidForTuple20"), - exclude[InheritedNewAbstractMethodProblem]("cats.kernel.instances.TupleInstances1.catsKernelStdCommutativeMonoidForTuple13"), - exclude[InheritedNewAbstractMethodProblem]("cats.kernel.instances.TupleInstances1.catsKernelStdCommutativeMonoidForTuple7"), - exclude[InheritedNewAbstractMethodProblem]("cats.kernel.instances.TupleInstances1.catsKernelStdCommutativeMonoidForTuple22"), - exclude[InheritedNewAbstractMethodProblem]("cats.kernel.instances.TupleInstances1.catsKernelStdCommutativeMonoidForTuple16"), - exclude[InheritedNewAbstractMethodProblem]("cats.kernel.instances.TupleInstances1.catsKernelStdCommutativeMonoidForTuple1"), - exclude[InheritedNewAbstractMethodProblem]("cats.kernel.instances.TupleInstances1.catsKernelStdCommutativeMonoidForTuple19"), - exclude[InheritedNewAbstractMethodProblem]("cats.kernel.instances.TupleInstances1.catsKernelStdCommutativeMonoidForTuple4"), - exclude[InheritedNewAbstractMethodProblem]("cats.kernel.instances.TupleInstances1.catsKernelStdCommutativeMonoidForTuple10"), - exclude[InheritedNewAbstractMethodProblem]("cats.kernel.instances.TupleInstances1.catsKernelStdCommutativeMonoidForTuple3"), - exclude[InheritedNewAbstractMethodProblem]("cats.kernel.instances.TupleInstances1.catsKernelStdCommutativeMonoidForTuple12"), - exclude[InheritedNewAbstractMethodProblem]("cats.kernel.instances.TupleInstances1.catsKernelStdCommutativeMonoidForTuple6"), - exclude[InheritedNewAbstractMethodProblem]("cats.kernel.instances.TupleInstances1.catsKernelStdCommutativeMonoidForTuple9"), - exclude[InheritedNewAbstractMethodProblem]("cats.kernel.instances.TupleInstances1.catsKernelStdCommutativeMonoidForTuple15"), - exclude[InheritedNewAbstractMethodProblem]("cats.kernel.instances.TupleInstances1.catsKernelStdCommutativeMonoidForTuple21"), - exclude[InheritedNewAbstractMethodProblem]("cats.kernel.instances.TupleInstances2.catsKernelStdCommutativeSemigroupForTuple9"), - exclude[InheritedNewAbstractMethodProblem]("cats.kernel.instances.TupleInstances2.catsKernelStdCommutativeSemigroupForTuple14"), - exclude[InheritedNewAbstractMethodProblem]("cats.kernel.instances.TupleInstances2.catsKernelStdCommutativeSemigroupForTuple20"), - exclude[InheritedNewAbstractMethodProblem]("cats.kernel.instances.TupleInstances2.catsKernelStdCommutativeSemigroupForTuple17"), - exclude[InheritedNewAbstractMethodProblem]("cats.kernel.instances.TupleInstances2.catsKernelStdCommutativeSemigroupForTuple11"), - exclude[InheritedNewAbstractMethodProblem]("cats.kernel.instances.TupleInstances2.catsKernelStdCommutativeSemigroupForTuple8"), - exclude[InheritedNewAbstractMethodProblem]("cats.kernel.instances.TupleInstances2.catsKernelStdCommutativeSemigroupForTuple2"), - exclude[InheritedNewAbstractMethodProblem]("cats.kernel.instances.TupleInstances2.catsKernelStdCommutativeSemigroupForTuple5"), - exclude[InheritedNewAbstractMethodProblem]("cats.kernel.instances.TupleInstances2.catsKernelStdCommutativeSemigroupForTuple19"), - exclude[InheritedNewAbstractMethodProblem]("cats.kernel.instances.TupleInstances2.catsKernelStdCommutativeSemigroupForTuple10"), - exclude[InheritedNewAbstractMethodProblem]("cats.kernel.instances.TupleInstances2.catsKernelStdCommutativeSemigroupForTuple13"), - exclude[InheritedNewAbstractMethodProblem]("cats.kernel.instances.TupleInstances2.catsKernelStdCommutativeSemigroupForTuple16"), - exclude[InheritedNewAbstractMethodProblem]("cats.kernel.instances.TupleInstances2.catsKernelStdCommutativeSemigroupForTuple22"), - exclude[InheritedNewAbstractMethodProblem]("cats.kernel.instances.TupleInstances2.catsKernelStdCommutativeSemigroupForTuple7"), - exclude[InheritedNewAbstractMethodProblem]("cats.kernel.instances.TupleInstances2.catsKernelStdCommutativeSemigroupForTuple1"), - exclude[InheritedNewAbstractMethodProblem]("cats.kernel.instances.TupleInstances2.catsKernelStdCommutativeSemigroupForTuple21"), - exclude[InheritedNewAbstractMethodProblem]("cats.kernel.instances.TupleInstances2.catsKernelStdCommutativeSemigroupForTuple4"), - exclude[InheritedNewAbstractMethodProblem]("cats.kernel.instances.TupleInstances2.catsKernelStdCommutativeSemigroupForTuple18"), - exclude[InheritedNewAbstractMethodProblem]("cats.kernel.instances.TupleInstances2.catsKernelStdCommutativeSemigroupForTuple12"), - exclude[InheritedNewAbstractMethodProblem]("cats.kernel.instances.TupleInstances2.catsKernelStdCommutativeSemigroupForTuple15"), - exclude[InheritedNewAbstractMethodProblem]("cats.kernel.instances.TupleInstances2.catsKernelStdCommutativeSemigroupForTuple3"), - exclude[InheritedNewAbstractMethodProblem]("cats.kernel.instances.TupleInstances2.catsKernelStdCommutativeSemigroupForTuple6"), - exclude[InheritedNewAbstractMethodProblem]("cats.kernel.instances.TupleInstances1.catsKernelStdCommutativeMonoidForTuple18"), - exclude[InheritedNewAbstractMethodProblem]("cats.kernel.instances.TupleInstances1.catsKernelStdCommutativeMonoidForTuple8"), - exclude[InheritedNewAbstractMethodProblem]("cats.kernel.instances.TupleInstances1.catsKernelStdCommutativeMonoidForTuple17"), - exclude[InheritedNewAbstractMethodProblem]("cats.kernel.instances.TupleInstances1.catsKernelStdCommutativeMonoidForTuple2"), - exclude[InheritedNewAbstractMethodProblem]("cats.kernel.instances.TupleInstances1.catsKernelStdCommutativeMonoidForTuple11"), - exclude[InheritedNewAbstractMethodProblem]("cats.kernel.instances.TupleInstances1.catsKernelStdCommutativeMonoidForTuple5"), - exclude[InheritedNewAbstractMethodProblem]("cats.kernel.instances.TupleInstances1.catsKernelStdCommutativeMonoidForTuple14"), - exclude[InheritedNewAbstractMethodProblem]("cats.kernel.instances.TupleInstances1.catsKernelStdCommutativeMonoidForTuple20"), - exclude[InheritedNewAbstractMethodProblem]("cats.kernel.instances.TupleInstances1.catsKernelStdCommutativeMonoidForTuple13"), - exclude[InheritedNewAbstractMethodProblem]("cats.kernel.instances.TupleInstances1.catsKernelStdCommutativeMonoidForTuple7"), - exclude[InheritedNewAbstractMethodProblem]("cats.kernel.instances.TupleInstances1.catsKernelStdCommutativeMonoidForTuple22"), - exclude[InheritedNewAbstractMethodProblem]("cats.kernel.instances.TupleInstances1.catsKernelStdCommutativeMonoidForTuple16"), - exclude[InheritedNewAbstractMethodProblem]("cats.kernel.instances.TupleInstances1.catsKernelStdCommutativeMonoidForTuple1"), - exclude[InheritedNewAbstractMethodProblem]("cats.kernel.instances.TupleInstances1.catsKernelStdCommutativeMonoidForTuple19"), - exclude[InheritedNewAbstractMethodProblem]("cats.kernel.instances.TupleInstances1.catsKernelStdCommutativeMonoidForTuple4"), - exclude[InheritedNewAbstractMethodProblem]("cats.kernel.instances.TupleInstances1.catsKernelStdCommutativeMonoidForTuple10"), - exclude[InheritedNewAbstractMethodProblem]("cats.kernel.instances.TupleInstances1.catsKernelStdCommutativeMonoidForTuple3"), - exclude[InheritedNewAbstractMethodProblem]("cats.kernel.instances.TupleInstances1.catsKernelStdCommutativeMonoidForTuple12"), - exclude[InheritedNewAbstractMethodProblem]("cats.kernel.instances.TupleInstances1.catsKernelStdCommutativeMonoidForTuple6"), - exclude[InheritedNewAbstractMethodProblem]("cats.kernel.instances.TupleInstances1.catsKernelStdCommutativeMonoidForTuple9"), - exclude[InheritedNewAbstractMethodProblem]("cats.kernel.instances.TupleInstances1.catsKernelStdCommutativeMonoidForTuple15"), - exclude[InheritedNewAbstractMethodProblem]("cats.kernel.instances.TupleInstances1.catsKernelStdCommutativeMonoidForTuple21"), - exclude[InheritedNewAbstractMethodProblem]("cats.kernel.instances.TupleInstances2.catsKernelStdCommutativeSemigroupForTuple9"), - exclude[InheritedNewAbstractMethodProblem]("cats.kernel.instances.TupleInstances2.catsKernelStdCommutativeSemigroupForTuple14"), - exclude[InheritedNewAbstractMethodProblem]("cats.kernel.instances.TupleInstances2.catsKernelStdCommutativeSemigroupForTuple20"), - exclude[InheritedNewAbstractMethodProblem]("cats.kernel.instances.TupleInstances2.catsKernelStdCommutativeSemigroupForTuple17"), - exclude[InheritedNewAbstractMethodProblem]("cats.kernel.instances.TupleInstances2.catsKernelStdCommutativeSemigroupForTuple11"), - exclude[InheritedNewAbstractMethodProblem]("cats.kernel.instances.TupleInstances2.catsKernelStdCommutativeSemigroupForTuple8"), - exclude[InheritedNewAbstractMethodProblem]("cats.kernel.instances.TupleInstances2.catsKernelStdCommutativeSemigroupForTuple2"), - exclude[InheritedNewAbstractMethodProblem]("cats.kernel.instances.TupleInstances2.catsKernelStdCommutativeSemigroupForTuple5"), - exclude[InheritedNewAbstractMethodProblem]("cats.kernel.instances.TupleInstances2.catsKernelStdCommutativeSemigroupForTuple19"), - exclude[InheritedNewAbstractMethodProblem]("cats.kernel.instances.TupleInstances2.catsKernelStdCommutativeSemigroupForTuple10"), - exclude[InheritedNewAbstractMethodProblem]("cats.kernel.instances.TupleInstances2.catsKernelStdCommutativeSemigroupForTuple13"), - exclude[InheritedNewAbstractMethodProblem]("cats.kernel.instances.TupleInstances2.catsKernelStdCommutativeSemigroupForTuple16"), - exclude[InheritedNewAbstractMethodProblem]("cats.kernel.instances.TupleInstances2.catsKernelStdCommutativeSemigroupForTuple22"), - exclude[InheritedNewAbstractMethodProblem]("cats.kernel.instances.TupleInstances2.catsKernelStdCommutativeSemigroupForTuple7"), - exclude[InheritedNewAbstractMethodProblem]("cats.kernel.instances.TupleInstances2.catsKernelStdCommutativeSemigroupForTuple1"), - exclude[InheritedNewAbstractMethodProblem]("cats.kernel.instances.TupleInstances2.catsKernelStdCommutativeSemigroupForTuple21"), - exclude[InheritedNewAbstractMethodProblem]("cats.kernel.instances.TupleInstances2.catsKernelStdCommutativeSemigroupForTuple4"), - exclude[InheritedNewAbstractMethodProblem]("cats.kernel.instances.TupleInstances2.catsKernelStdCommutativeSemigroupForTuple18"), - exclude[InheritedNewAbstractMethodProblem]("cats.kernel.instances.TupleInstances2.catsKernelStdCommutativeSemigroupForTuple12"), - exclude[InheritedNewAbstractMethodProblem]("cats.kernel.instances.TupleInstances2.catsKernelStdCommutativeSemigroupForTuple15"), - exclude[InheritedNewAbstractMethodProblem]("cats.kernel.instances.TupleInstances2.catsKernelStdCommutativeSemigroupForTuple3"), - exclude[InheritedNewAbstractMethodProblem]("cats.kernel.instances.TupleInstances2.catsKernelStdCommutativeSemigroupForTuple6"), - exclude[InheritedNewAbstractMethodProblem]("cats.kernel.instances.QueueInstances.*"), - exclude[InheritedNewAbstractMethodProblem]("cats.kernel.instances.QueueInstances1.*"), - exclude[InheritedNewAbstractMethodProblem]("cats.kernel.instances.QueueInstances2.*"), - exclude[InheritedNewAbstractMethodProblem]("cats.kernel.instances.DurationInstances.*"), - exclude[UpdateForwarderBodyProblem]("cats.kernel.instances.MapInstances.catsKernelStdEqForMap"), - exclude[UpdateForwarderBodyProblem]("cats.kernel.instances.MapInstances.catsKernelStdMonoidForMap"), - exclude[ReversedMissingMethodProblem]("cats.kernel.instances.MapInstances.catsKernelStdHashForMap"), - exclude[UpdateForwarderBodyProblem]("cats.kernel.instances.OptionInstances0.catsKernelStdEqForOption"), - exclude[UpdateForwarderBodyProblem]("cats.kernel.instances.TupleInstances.catsKernelStdEqForTuple12"), - exclude[UpdateForwarderBodyProblem]("cats.kernel.instances.TupleInstances.catsKernelStdEqForTuple7"), - exclude[UpdateForwarderBodyProblem]("cats.kernel.instances.TupleInstances.catsKernelStdPartialOrderForTuple4"), - exclude[UpdateForwarderBodyProblem]("cats.kernel.instances.TupleInstances.catsKernelStdPartialOrderForTuple13"), - exclude[UpdateForwarderBodyProblem]("cats.kernel.instances.TupleInstances.catsKernelStdEqForTuple11"), - exclude[UpdateForwarderBodyProblem]("cats.kernel.instances.TupleInstances.catsKernelStdEqForTuple1"), - exclude[UpdateForwarderBodyProblem]("cats.kernel.instances.TupleInstances.catsKernelStdPartialOrderForTuple7"), - exclude[UpdateForwarderBodyProblem]("cats.kernel.instances.TupleInstances.catsKernelStdPartialOrderForTuple16"), - exclude[UpdateForwarderBodyProblem]("cats.kernel.instances.TupleInstances.catsKernelStdPartialOrderForTuple22"), - exclude[UpdateForwarderBodyProblem]("cats.kernel.instances.TupleInstances.catsKernelStdPartialOrderForTuple1"), - exclude[UpdateForwarderBodyProblem]("cats.kernel.instances.TupleInstances.catsKernelStdEqForTuple14"), - exclude[UpdateForwarderBodyProblem]("cats.kernel.instances.TupleInstances.catsKernelStdEqForTuple4"), - exclude[UpdateForwarderBodyProblem]("cats.kernel.instances.TupleInstances.catsKernelStdEqForTuple20"), - exclude[UpdateForwarderBodyProblem]("cats.kernel.instances.TupleInstances.catsKernelStdPartialOrderForTuple19"), - exclude[UpdateForwarderBodyProblem]("cats.kernel.instances.TupleInstances.catsKernelStdPartialOrderForTuple10"), - exclude[UpdateForwarderBodyProblem]("cats.kernel.instances.TupleInstances.catsKernelStdEqForTuple17"), - exclude[UpdateForwarderBodyProblem]("cats.kernel.instances.TupleInstances.catsKernelStdPartialOrderForTuple18"), - exclude[UpdateForwarderBodyProblem]("cats.kernel.instances.TupleInstances.catsKernelStdEqForTuple3"), - exclude[UpdateForwarderBodyProblem]("cats.kernel.instances.TupleInstances.catsKernelStdPartialOrderForTuple9"), - exclude[UpdateForwarderBodyProblem]("cats.kernel.instances.TupleInstances.catsKernelStdEqForTuple6"), - exclude[UpdateForwarderBodyProblem]("cats.kernel.instances.TupleInstances.catsKernelStdPartialOrderForTuple3"), - exclude[UpdateForwarderBodyProblem]("cats.kernel.instances.TupleInstances.catsKernelStdPartialOrderForTuple12"), - exclude[UpdateForwarderBodyProblem]("cats.kernel.instances.TupleInstances.catsKernelStdEqForTuple22"), - exclude[UpdateForwarderBodyProblem]("cats.kernel.instances.TupleInstances.catsKernelStdPartialOrderForTuple6"), - exclude[UpdateForwarderBodyProblem]("cats.kernel.instances.TupleInstances.catsKernelStdEqForTuple19"), - exclude[UpdateForwarderBodyProblem]("cats.kernel.instances.TupleInstances.catsKernelStdEqForTuple10"), - exclude[UpdateForwarderBodyProblem]("cats.kernel.instances.TupleInstances.catsKernelStdEqForTuple9"), - exclude[UpdateForwarderBodyProblem]("cats.kernel.instances.TupleInstances.catsKernelStdPartialOrderForTuple21"), - exclude[UpdateForwarderBodyProblem]("cats.kernel.instances.TupleInstances.catsKernelStdPartialOrderForTuple15"), - exclude[UpdateForwarderBodyProblem]("cats.kernel.instances.TupleInstances.catsKernelStdEqForTuple13"), - exclude[UpdateForwarderBodyProblem]("cats.kernel.instances.TupleInstances.catsKernelStdEqForTuple16"), - exclude[UpdateForwarderBodyProblem]("cats.kernel.instances.TupleInstances.catsKernelStdPartialOrderForTuple20"), - exclude[UpdateForwarderBodyProblem]("cats.kernel.instances.TupleInstances.catsKernelStdPartialOrderForTuple14"), - exclude[UpdateForwarderBodyProblem]("cats.kernel.instances.TupleInstances.catsKernelStdPartialOrderForTuple5"), - exclude[UpdateForwarderBodyProblem]("cats.kernel.instances.TupleInstances.catsKernelStdEqForTuple2"), - exclude[UpdateForwarderBodyProblem]("cats.kernel.instances.TupleInstances.catsKernelStdPartialOrderForTuple8"), - exclude[UpdateForwarderBodyProblem]("cats.kernel.instances.TupleInstances.catsKernelStdPartialOrderForTuple17"), - exclude[UpdateForwarderBodyProblem]("cats.kernel.instances.TupleInstances.catsKernelStdEqForTuple5"), - exclude[UpdateForwarderBodyProblem]("cats.kernel.instances.TupleInstances.catsKernelStdEqForTuple15"), - exclude[UpdateForwarderBodyProblem]("cats.kernel.instances.TupleInstances.catsKernelStdEqForTuple21"), - exclude[UpdateForwarderBodyProblem]("cats.kernel.instances.TupleInstances.catsKernelStdPartialOrderForTuple11"), - exclude[UpdateForwarderBodyProblem]("cats.kernel.instances.TupleInstances.catsKernelStdPartialOrderForTuple2"), - exclude[UpdateForwarderBodyProblem]("cats.kernel.instances.TupleInstances.catsKernelStdEqForTuple8"), - exclude[UpdateForwarderBodyProblem]("cats.kernel.instances.TupleInstances.catsKernelStdEqForTuple18"), - exclude[InheritedNewAbstractMethodProblem]("cats.kernel.instances.TupleInstances1.catsKernelStdHashForTuple9"), - exclude[InheritedNewAbstractMethodProblem]("cats.kernel.instances.TupleInstances1.catsKernelStdHashForTuple16"), - exclude[InheritedNewAbstractMethodProblem]("cats.kernel.instances.TupleInstances1.catsKernelStdHashForTuple22"), - exclude[InheritedNewAbstractMethodProblem]("cats.kernel.instances.TupleInstances1.catsKernelStdHashForTuple3"), - exclude[InheritedNewAbstractMethodProblem]("cats.kernel.instances.TupleInstances1.catsKernelStdHashForTuple6"), - exclude[InheritedNewAbstractMethodProblem]("cats.kernel.instances.TupleInstances1.catsKernelStdHashForTuple21"), - exclude[InheritedNewAbstractMethodProblem]("cats.kernel.instances.TupleInstances1.catsKernelStdHashForTuple18"), - exclude[InheritedNewAbstractMethodProblem]("cats.kernel.instances.TupleInstances1.catsKernelStdHashForTuple12"), - exclude[InheritedNewAbstractMethodProblem]("cats.kernel.instances.TupleInstances1.catsKernelStdHashForTuple15"), - exclude[InheritedNewAbstractMethodProblem]("cats.kernel.instances.TupleInstances1.catsKernelStdHashForTuple8"), - exclude[InheritedNewAbstractMethodProblem]("cats.kernel.instances.TupleInstances1.catsKernelStdHashForTuple2"), - exclude[InheritedNewAbstractMethodProblem]("cats.kernel.instances.TupleInstances1.catsKernelStdHashForTuple5"), - exclude[InheritedNewAbstractMethodProblem]("cats.kernel.instances.TupleInstances1.catsKernelStdHashForTuple20"), - exclude[InheritedNewAbstractMethodProblem]("cats.kernel.instances.TupleInstances1.catsKernelStdHashForTuple14"), - exclude[InheritedNewAbstractMethodProblem]("cats.kernel.instances.TupleInstances1.catsKernelStdHashForTuple17"), - exclude[InheritedNewAbstractMethodProblem]("cats.kernel.instances.TupleInstances1.catsKernelStdHashForTuple4"), - exclude[InheritedNewAbstractMethodProblem]("cats.kernel.instances.TupleInstances1.catsKernelStdHashForTuple11"), - exclude[InheritedNewAbstractMethodProblem]("cats.kernel.instances.TupleInstances1.catsKernelStdHashForTuple7"), - exclude[InheritedNewAbstractMethodProblem]("cats.kernel.instances.TupleInstances1.catsKernelStdHashForTuple1"), - exclude[InheritedNewAbstractMethodProblem]("cats.kernel.instances.TupleInstances1.catsKernelStdHashForTuple10"), - exclude[InheritedNewAbstractMethodProblem]("cats.kernel.instances.TupleInstances1.catsKernelStdHashForTuple19"), - exclude[InheritedNewAbstractMethodProblem]("cats.kernel.instances.TupleInstances1.catsKernelStdHashForTuple13"), - exclude[ReversedMissingMethodProblem]("cats.kernel.instances.StreamInstances1.catsKernelStdHashForStream"), - exclude[ReversedMissingMethodProblem]("cats.kernel.instances.ListInstances1.catsKernelStdHashForList"), - exclude[UpdateForwarderBodyProblem]("cats.kernel.instances.SetInstances.catsKernelStdPartialOrderForSet"), - exclude[UpdateForwarderBodyProblem]("cats.kernel.instances.SetInstances.catsKernelStdSemilatticeForSet"), - exclude[ReversedMissingMethodProblem]("cats.kernel.instances.SetInstances.catsKernelStdHashForSet"), - exclude[ReversedMissingMethodProblem]("cats.kernel.instances.VectorInstances1.catsKernelStdHashForVector"), - exclude[DirectMissingMethodProblem]("cats.kernel.instances.BitSetInstances.catsKernelStdPartialOrderForBitSet"), - exclude[ReversedMissingMethodProblem]("cats.kernel.instances.BitSetInstances.cats$kernel$instances$BitSetInstances$_setter_$catsKernelStdOrderForBitSet_="), - exclude[ReversedMissingMethodProblem]("cats.kernel.instances.BitSetInstances.catsKernelStdOrderForBitSet"), - exclude[InheritedNewAbstractMethodProblem]("cats.kernel.instances.TupleInstances1.catsKernelStdHashForTuple9"), - exclude[InheritedNewAbstractMethodProblem]("cats.kernel.instances.TupleInstances1.catsKernelStdHashForTuple16"), - exclude[InheritedNewAbstractMethodProblem]("cats.kernel.instances.TupleInstances1.catsKernelStdHashForTuple22"), - exclude[InheritedNewAbstractMethodProblem]("cats.kernel.instances.TupleInstances1.catsKernelStdHashForTuple3"), - exclude[InheritedNewAbstractMethodProblem]("cats.kernel.instances.TupleInstances1.catsKernelStdHashForTuple6"), - exclude[InheritedNewAbstractMethodProblem]("cats.kernel.instances.TupleInstances1.catsKernelStdHashForTuple21"), - exclude[InheritedNewAbstractMethodProblem]("cats.kernel.instances.TupleInstances1.catsKernelStdHashForTuple18"), - exclude[InheritedNewAbstractMethodProblem]("cats.kernel.instances.TupleInstances1.catsKernelStdHashForTuple12"), - exclude[InheritedNewAbstractMethodProblem]("cats.kernel.instances.TupleInstances1.catsKernelStdHashForTuple15"), - exclude[InheritedNewAbstractMethodProblem]("cats.kernel.instances.TupleInstances1.catsKernelStdHashForTuple8"), - exclude[InheritedNewAbstractMethodProblem]("cats.kernel.instances.TupleInstances1.catsKernelStdHashForTuple2"), - exclude[InheritedNewAbstractMethodProblem]("cats.kernel.instances.TupleInstances1.catsKernelStdHashForTuple5"), - exclude[InheritedNewAbstractMethodProblem]("cats.kernel.instances.TupleInstances1.catsKernelStdHashForTuple20"), - exclude[InheritedNewAbstractMethodProblem]("cats.kernel.instances.TupleInstances1.catsKernelStdHashForTuple14"), - exclude[InheritedNewAbstractMethodProblem]("cats.kernel.instances.TupleInstances1.catsKernelStdHashForTuple17"), - exclude[InheritedNewAbstractMethodProblem]("cats.kernel.instances.TupleInstances1.catsKernelStdHashForTuple4"), - exclude[InheritedNewAbstractMethodProblem]("cats.kernel.instances.TupleInstances1.catsKernelStdHashForTuple11"), - exclude[InheritedNewAbstractMethodProblem]("cats.kernel.instances.TupleInstances1.catsKernelStdHashForTuple7"), - exclude[InheritedNewAbstractMethodProblem]("cats.kernel.instances.TupleInstances1.catsKernelStdHashForTuple1"), - exclude[InheritedNewAbstractMethodProblem]("cats.kernel.instances.TupleInstances1.catsKernelStdHashForTuple10"), - exclude[InheritedNewAbstractMethodProblem]("cats.kernel.instances.TupleInstances1.catsKernelStdHashForTuple19"), - exclude[InheritedNewAbstractMethodProblem]("cats.kernel.instances.TupleInstances1.catsKernelStdHashForTuple13"), - exclude[InheritedNewAbstractMethodProblem]("cats.kernel.instances.EitherInstances1.catsStdEqForEither"), - exclude[InheritedNewAbstractMethodProblem]("cats.kernel.instances.EitherInstances.catsStdOrderForEither"), - exclude[InheritedNewAbstractMethodProblem]("cats.kernel.instances.EitherInstances.catsDataMonoidForEither"), - exclude[InheritedNewAbstractMethodProblem]("cats.kernel.instances.EitherInstances0.catsDataSemigroupForEither"), - exclude[InheritedNewAbstractMethodProblem]("cats.kernel.instances.EitherInstances0.catsStdHashForEither"), - exclude[InheritedNewAbstractMethodProblem]("cats.kernel.instances.EitherInstances0.catsStdPartialOrderForEither"), - exclude[ReversedMissingMethodProblem]("cats.kernel.instances.OptionInstances1.catsKernelStdHashForOption"), - exclude[ReversedMissingMethodProblem]("cats.kernel.instances.FunctionInstances0.catsKernelHashForFunction0"), - exclude[ReversedMissingMethodProblem]("cats.kernel.instances.OptionInstances0.catsKernelStdPartialOrderForOption"), - exclude[ReversedMissingMethodProblem]("cats.kernel.instances.EitherInstances0.catsStdHashForEither"), - exclude[DirectMissingMethodProblem]("cats.kernel.instances.OptionInstances1.catsKernelStdPartialOrderForOption"), - exclude[DirectMissingMethodProblem]("cats.kernel.instances.all.package.catsKernelStdPartialOrderForBitSet"), - exclude[DirectMissingMethodProblem]("cats.kernel.instances.bitSet.package.catsKernelStdPartialOrderForBitSet"), - exclude[MissingTypesProblem]("cats.kernel.instances.OptionInstances1"), - exclude[InheritedNewAbstractMethodProblem]("cats.kernel.instances.OptionInstances1.catsKernelStdHashForOption"), - exclude[InheritedNewAbstractMethodProblem]("cats.kernel.instances.QueueInstances.*"), - exclude[InheritedNewAbstractMethodProblem]("cats.kernel.instances.QueueInstances1.*"), - exclude[InheritedNewAbstractMethodProblem]("cats.kernel.instances.QueueInstances2.*"), - exclude[InheritedNewAbstractMethodProblem]("cats.kernel.instances.DurationInstances.*") - ) -} lazy val kernel = crossProject.crossType(CrossType.Pure) .in(file("kernel")) @@ -615,15 +253,8 @@ lazy val kernel = crossProject.crossType(CrossType.Pure) .settings(sourceGenerators in Compile += (sourceManaged in Compile).map(KernelBoiler.gen).taskValue) .settings(includeGeneratedSrc) .jsSettings(commonJsSettings) - .jvmSettings(commonJvmSettings ++ Seq( - mimaPreviousArtifacts := { - if (scalaVersion.value startsWith "2.12") - Set() - else - Set("org.typelevel" %% "cats-kernel" % binaryCompatibleVersion) - }, - mimaBinaryIssueFilters ++= binaryCompatibleExceptions - )) + .jvmSettings(commonJvmSettings ++ mimaSettings("cats-kernel")) + lazy val kernelJVM = kernel.jvm lazy val kernelJS = kernel.js @@ -654,7 +285,7 @@ lazy val core = crossProject.crossType(CrossType.Pure) .configureCross(disableScoverage210Js) .settings(libraryDependencies += "org.scalacheck" %%% "scalacheck" % scalaCheckVersion % "test") .jsSettings(commonJsSettings) - .jvmSettings(commonJvmSettings) + .jvmSettings(commonJvmSettings ++ mimaSettings("cats-core") ) lazy val coreJVM = core.jvm lazy val coreJS = core.js @@ -678,7 +309,7 @@ lazy val free = crossProject.crossType(CrossType.Pure) .settings(moduleName := "cats-free", name := "Cats Free") .settings(catsSettings) .jsSettings(commonJsSettings) - .jvmSettings(commonJvmSettings) + .jvmSettings(commonJvmSettings ++ mimaSettings("cats-free")) lazy val freeJVM = free.jvm lazy val freeJS = free.js diff --git a/core/src/main/scala/cats/ContravariantCartesian.scala b/core/src/main/scala/cats/ContravariantSemigroupal.scala similarity index 100% rename from core/src/main/scala/cats/ContravariantCartesian.scala rename to core/src/main/scala/cats/ContravariantSemigroupal.scala diff --git a/core/src/main/scala/cats/Foldable.scala b/core/src/main/scala/cats/Foldable.scala index 27cf6cc946..779f19190c 100644 --- a/core/src/main/scala/cats/Foldable.scala +++ b/core/src/main/scala/cats/Foldable.scala @@ -31,8 +31,29 @@ import simulacrum.typeclass @typeclass trait Foldable[F[_]] extends UnorderedFoldable[F] { self => /** - * Left associative fold on 'F' using the function 'f'. - */ + * Left associative fold on 'F' using the function 'f'. + * + * Example: + * {{{ + * scala> import cats.Foldable, cats.implicits._ + * scala> val fa = Option(1) + * + * Folding by addition to zero: + * scala> Foldable[Option].foldLeft(fa, Option(0))((a, n) => a.map(_ + n)) + * res0: Option[Int] = Some(1) + * }}} + * + * With syntax extensions, `foldLeft` can be used like: + * {{{ + * Folding `Option` with addition from zero: + * scala> fa.foldLeft(Option(0))((a, n) => a.map(_ + n)) + * res1: Option[Int] = Some(1) + * + * There's also an alias `foldl` which is equivalent: + * scala> fa.foldl(Option(0))((a, n) => a.map(_ + n)) + * res2: Option[Int] = Some(1) + * }}} + */ def foldLeft[A, B](fa: F[A], b: B)(f: (B, A) => B): B @@ -46,6 +67,32 @@ import simulacrum.typeclass * * For more detailed information about how this method works see the * documentation for `Eval[_]`. + * + * Example: + * {{{ + * scala> import cats.Foldable, cats.Eval, cats.implicits._ + * scala> val fa = Option(1) + * + * Folding by addition to zero: + * scala> val folded1 = Foldable[Option].foldRight(fa, Eval.now(0))((n, a) => a.map(_ + n)) + * Since `foldRight` yields a lazy computation, we need to force it to inspect the result: + * scala> folded1.value + * res0: Int = 1 + * + * With syntax extensions, we can write the same thing like this: + * scala> val folded2 = fa.foldRight(Eval.now(0))((n, a) => a.map(_ + n)) + * scala> folded2.value + * res1: Int = 1 + * + * Unfortunately, since `foldRight` is defined on many collections - this + * extension clashes with the operation defined in `Foldable`. + * + * To get past this and make sure you're getting the lazy `foldRight` defined + * in `Foldable`, there's an alias `foldr`: + * scala> val folded3 = fa.foldr(Eval.now(0))((n, a) => a.map(_ + n)) + * scala> folded3.value + * res1: Int = 1 + * }}} */ def foldRight[A, B](fa: F[A], lb: Eval[B])(f: (A, Eval[B]) => Eval[B]): Eval[B] diff --git a/core/src/main/scala/cats/data/EitherK.scala b/core/src/main/scala/cats/data/EitherK.scala index 4eb085efc6..e62fa7d509 100644 --- a/core/src/main/scala/cats/data/EitherK.scala +++ b/core/src/main/scala/cats/data/EitherK.scala @@ -16,6 +16,12 @@ final case class EitherK[F[_], G[_], A](run: Either[F[A], G[A]]) { def map[B](f: A => B)(implicit F: Functor[F], G: Functor[G]): EitherK[F, G, B] = EitherK(run.bimap(F.lift(f), G.lift(f))) + /** + * Modify the right side context `G` using transformation `f`. + */ + def mapK[H[_]](f: G ~> H): EitherK[F, H, A] = + EitherK(run.map(f.apply)) + def coflatMap[B](f: EitherK[F, G, A] => B)(implicit F: CoflatMap[F], G: CoflatMap[G]): EitherK[F, G, B] = EitherK( run.bimap(a => F.coflatMap(a)(x => f(leftc(x))), a => G.coflatMap(a)(x => f(rightc(x)))) @@ -234,4 +240,3 @@ private[data] trait EitherKComonad[F[_], G[_]] extends Comonad[EitherK[F, G, ?]] def extract[A](p: EitherK[F, G, A]): A = p.extract } - diff --git a/core/src/main/scala/cats/data/EitherT.scala b/core/src/main/scala/cats/data/EitherT.scala index b0f8094eb0..85ac89d315 100644 --- a/core/src/main/scala/cats/data/EitherT.scala +++ b/core/src/main/scala/cats/data/EitherT.scala @@ -91,6 +91,11 @@ final case class EitherT[F[_], A, B](value: F[Either[A, B]]) { def map[D](f: B => D)(implicit F: Functor[F]): EitherT[F, A, D] = bimap(identity, f) + /** + * Modify the context `F` using transformation `f`. + */ + def mapK[G[_]](f: F ~> G): EitherT[G, A, B] = EitherT[G, A, B](f(value)) + def semiflatMap[D](f: B => F[D])(implicit F: Monad[F]): EitherT[F, A, D] = flatMap(b => EitherT.right(f(b))) diff --git a/core/src/main/scala/cats/data/Func.scala b/core/src/main/scala/cats/data/Func.scala index db069f4362..17b480048e 100644 --- a/core/src/main/scala/cats/data/Func.scala +++ b/core/src/main/scala/cats/data/Func.scala @@ -12,6 +12,12 @@ sealed abstract class Func[F[_], A, B] { self => def run: A => F[B] def map[C](f: B => C)(implicit FF: Functor[F]): Func[F, A, C] = Func.func(a => FF.map(self.run(a))(f)) + + /** + * Modify the context `F` using transformation `f`. + */ + def mapK[G[_]](f: F ~> G): Func[G, A, B] = + Func.func(run andThen f.apply) } object Func extends FuncInstances { diff --git a/core/src/main/scala/cats/data/IdT.scala b/core/src/main/scala/cats/data/IdT.scala index d8b3f09c35..c2fb5a4cce 100644 --- a/core/src/main/scala/cats/data/IdT.scala +++ b/core/src/main/scala/cats/data/IdT.scala @@ -9,6 +9,12 @@ final case class IdT[F[_], A](value: F[A]) { def map[B](f: A => B)(implicit F: Functor[F]): IdT[F, B] = IdT(F.map(value)(f)) + /** + * Modify the context `F` using transformation `f`. + */ + def mapK[G[_]](f: F ~> G): IdT[G, A] = + IdT[G, A](f(value)) + def flatMap[B](f: A => IdT[F, B])(implicit F: FlatMap[F]): IdT[F, B] = IdT(F.flatMap(value)(f.andThen(_.value))) @@ -151,7 +157,7 @@ private[data] sealed abstract class IdTInstances0 extends IdTInstances1 { new IdTTraverse[F] { implicit val F0: Traverse[F] = F } implicit def catsDataEqForIdT[F[_], A](implicit F: Eq[F[A]]): Eq[IdT[F, A]] = - F.on(_.value) + Eq.by[IdT[F, A], F[A]](_.value) } private[data] sealed abstract class IdTInstances extends IdTInstances0 { @@ -160,7 +166,7 @@ private[data] sealed abstract class IdTInstances extends IdTInstances0 { new IdTNonEmptyTraverse[F] { implicit val F0: NonEmptyTraverse[F] = F } implicit def catsDataOrderForIdT[F[_], A](implicit F: Order[F[A]]): Order[IdT[F, A]] = - F.on(_.value) + Order.by[IdT[F, A], F[A]](_.value) implicit def catsDataShowForIdT[F[_], A](implicit F: Show[F[A]]): Show[IdT[F, A]] = Contravariant[Show].contramap(F)(_.value) diff --git a/core/src/main/scala/cats/data/IndexedReaderWriterStateT.scala b/core/src/main/scala/cats/data/IndexedReaderWriterStateT.scala index 72b25d37c0..fc3ef56bd8 100644 --- a/core/src/main/scala/cats/data/IndexedReaderWriterStateT.scala +++ b/core/src/main/scala/cats/data/IndexedReaderWriterStateT.scala @@ -52,6 +52,13 @@ final class IndexedReaderWriterStateT[F[_], E, L, SA, SB, A](val runF: F[(E, SA) def map[B](f: A => B)(implicit F: Functor[F]): IndexedReaderWriterStateT[F, E, L, SA, SB, B] = transform { (l, s, a) => (l, s, f(a)) } + /** + * Modify the context `F` using transformation `f`. + */ + def mapK[G[_]](f: F ~> G)(implicit F: Functor[F]): IndexedReaderWriterStateT[G, E, L, SA, SB, A] = + IndexedReaderWriterStateT.applyF( + f(F.map(runF)(rwsa => (e, sa) => f(rwsa(e, sa))))) + /** * Modify the resulting state using `f` and the resulting value using `g`. */ diff --git a/core/src/main/scala/cats/data/IndexedStateT.scala b/core/src/main/scala/cats/data/IndexedStateT.scala index bd170310b7..c599eacf24 100644 --- a/core/src/main/scala/cats/data/IndexedStateT.scala +++ b/core/src/main/scala/cats/data/IndexedStateT.scala @@ -39,6 +39,13 @@ final class IndexedStateT[F[_], SA, SB, A](val runF: F[SA => F[(SB, A)]]) extend def map[B](f: A => B)(implicit F: Functor[F]): IndexedStateT[F, SA, SB, B] = transform { case (s, a) => (s, f(a)) } + /** + * Modify the context `F` using transformation `f`. + */ + def mapK[G[_]](f: F ~> G)(implicit F: Functor[F]): IndexedStateT[G, SA, SB, A] = + IndexedStateT.applyF( + f(F.map(runF)(_.andThen(fsa => f(fsa))))) + def contramap[S0](f: S0 => SA)(implicit F: Functor[F]): IndexedStateT[F, S0, SB, A] = IndexedStateT.applyF { F.map(runF) { safsba => diff --git a/core/src/main/scala/cats/data/Kleisli.scala b/core/src/main/scala/cats/data/Kleisli.scala index 6d33173ac0..d94ebb256b 100644 --- a/core/src/main/scala/cats/data/Kleisli.scala +++ b/core/src/main/scala/cats/data/Kleisli.scala @@ -21,6 +21,12 @@ final case class Kleisli[F[_], A, B](run: A => F[B]) { self => def mapF[N[_], C](f: F[B] => N[C]): Kleisli[N, A, C] = Kleisli(run andThen f) + /** + * Modify the context `F` using transformation `f`. + */ + def mapK[G[_]](f: F ~> G): Kleisli[G, A, B] = + Kleisli[G, A, B](run andThen f.apply) + def flatMap[C](f: B => Kleisli[F, A, C])(implicit F: FlatMap[F]): Kleisli[F, A, C] = Kleisli((r: A) => F.flatMap[B, C](run(r))((b: B) => f(b).run(r))) @@ -48,8 +54,9 @@ final case class Kleisli[F[_], A, B](run: A => F[B]) { self => def local[AA](f: AA => A): Kleisli[F, AA, B] = Kleisli(f.andThen(run)) + @deprecated("Use mapK", "1.0.0") def transform[G[_]](f: FunctionK[F, G]): Kleisli[G, A, B] = - Kleisli(a => f(run(a))) + mapK(f) def lower(implicit F: Applicative[F]): Kleisli[F, A, F[B]] = Kleisli(a => F.pure(run(a))) @@ -148,10 +155,10 @@ private[data] sealed abstract class KleisliInstances1 extends KleisliInstances2 def monad: Monad[Kleisli[M, A, ?]] = catsDataMonadForKleisli def sequential: Kleisli[F, A, ?] ~> Kleisli[M, A, ?] = - λ[Kleisli[F, A, ?] ~> Kleisli[M, A, ?]](_.transform(P.sequential)) + λ[Kleisli[F, A, ?] ~> Kleisli[M, A, ?]](_.mapK(P.sequential)) def parallel: Kleisli[M, A, ?] ~> Kleisli[F, A, ?] = - λ[Kleisli[M, A, ?] ~> Kleisli[F, A, ?]](_.transform(P.parallel)) + λ[Kleisli[M, A, ?] ~> Kleisli[F, A, ?]](_.mapK(P.parallel)) } } diff --git a/core/src/main/scala/cats/data/Nested.scala b/core/src/main/scala/cats/data/Nested.scala index 5a89bb44e7..23acf56332 100644 --- a/core/src/main/scala/cats/data/Nested.scala +++ b/core/src/main/scala/cats/data/Nested.scala @@ -23,13 +23,21 @@ package data * res1: List[Option[String]] = List(Some(2), None) * }}} */ -final case class Nested[F[_], G[_], A](value: F[G[A]]) +final case class Nested[F[_], G[_], A](value: F[G[A]]) { + + /** + * Modify the context `F` using transformation `f`. + */ + def mapK[H[_]](f: F ~> H): Nested[H, G, A] = + Nested(f(value)) + +} object Nested extends NestedInstances private[data] sealed abstract class NestedInstances extends NestedInstances0 { implicit def catsDataEqForNested[F[_], G[_], A](implicit FGA: Eq[F[G[A]]]): Eq[Nested[F, G, A]] = - FGA.on(_.value) + Eq.by[Nested[F, G, A], F[G[A]]](_.value) implicit def catsDataNonEmptyTraverseForNested[F[_]: NonEmptyTraverse, G[_]: NonEmptyTraverse]: NonEmptyTraverse[Nested[F, G, ?]] = new NestedNonEmptyTraverse[F, G] { diff --git a/core/src/main/scala/cats/data/NonEmptyList.scala b/core/src/main/scala/cats/data/NonEmptyList.scala index 7140b88e19..95a7047b7c 100644 --- a/core/src/main/scala/cats/data/NonEmptyList.scala +++ b/core/src/main/scala/cats/data/NonEmptyList.scala @@ -99,6 +99,19 @@ final case class NonEmptyList[+A](head: A, tail: List[A]) { def prepend[AA >: A](a: AA): NonEmptyList[AA] = NonEmptyList(a, head :: tail) + /** + * Alias for concat + * + * {{{ + * scala> import cats.data.NonEmptyList + * scala> val nel = NonEmptyList.of(1, 2, 3) + * scala> nel ::: NonEmptyList.of(4, 5) + * res0: cats.data.NonEmptyList[Int] = NonEmptyList(1, 2, 3, 4, 5) + * }}} + */ + def :::[AA >: A](other: NonEmptyList[AA]): NonEmptyList[AA] = + other.concatNel(this) + /** * Remove elements not matching the predicate * diff --git a/core/src/main/scala/cats/data/NonEmptyVector.scala b/core/src/main/scala/cats/data/NonEmptyVector.scala index 5beb74618b..7f9f9c46aa 100644 --- a/core/src/main/scala/cats/data/NonEmptyVector.scala +++ b/core/src/main/scala/cats/data/NonEmptyVector.scala @@ -71,6 +71,18 @@ final class NonEmptyVector[+A] private (val toVector: Vector[A]) extends AnyVal */ def ++[AA >: A](other: Vector[AA]): NonEmptyVector[AA] = concat(other) + /** + * Append this NEV to another NEV, producing a new `NonEmptyVector`. + * + * {{{ + * scala> import cats.data.NonEmptyVector + * scala> val nev = NonEmptyVector.of(1, 2, 3) + * scala> nev ++: NonEmptyVector.of(4, 5) + * res0: cats.data.NonEmptyVector[Int] = NonEmptyVector(1, 2, 3, 4, 5) + * }}} + */ + def ++:[AA >: A](other: NonEmptyVector[AA]): NonEmptyVector[AA] = other.concatNev(this) + /** * Append another `Vector` to this, producing a new `NonEmptyVector`. */ diff --git a/core/src/main/scala/cats/data/OneAnd.scala b/core/src/main/scala/cats/data/OneAnd.scala index 038b9eb719..0bbd9a6d97 100644 --- a/core/src/main/scala/cats/data/OneAnd.scala +++ b/core/src/main/scala/cats/data/OneAnd.scala @@ -76,6 +76,12 @@ final case class OneAnd[F[_], A](head: A, tail: F[A]) { def map[B](f: A => B)(implicit F: Functor[F]): OneAnd[F, B] = OneAnd(f(head), F.map(tail)(f)) + /** + * Modify the context `F` using transformation `f`. + */ + def mapK[G[_]](f: F ~> G): OneAnd[G, A] = + OneAnd(head, f(tail)) + /** * Typesafe equality operator. * diff --git a/core/src/main/scala/cats/data/OptionT.scala b/core/src/main/scala/cats/data/OptionT.scala index 6dfab405da..cf59218c8f 100644 --- a/core/src/main/scala/cats/data/OptionT.scala +++ b/core/src/main/scala/cats/data/OptionT.scala @@ -28,6 +28,11 @@ final case class OptionT[F[_], A](value: F[Option[A]]) { def map[B](f: A => B)(implicit F: Functor[F]): OptionT[F, B] = OptionT(F.map(value)(_.map(f))) + /** + * Modify the context `F` using transformation `f`. + */ + def mapK[G[_]](f: F ~> G): OptionT[G, A] = OptionT[G, A](f(value)) + def semiflatMap[B](f: A => F[B])(implicit F: Monad[F]): OptionT[F, B] = flatMap(a => OptionT.liftF(f(a))) diff --git a/core/src/main/scala/cats/data/Tuple2K.scala b/core/src/main/scala/cats/data/Tuple2K.scala index 054f12359c..ab246e454f 100644 --- a/core/src/main/scala/cats/data/Tuple2K.scala +++ b/core/src/main/scala/cats/data/Tuple2K.scala @@ -8,7 +8,15 @@ import cats.Contravariant * * See: [[https://www.cs.ox.ac.uk/jeremy.gibbons/publications/iterator.pdf The Essence of the Iterator Pattern]] */ -final case class Tuple2K[F[_], G[_], A](first: F[A], second: G[A]) +final case class Tuple2K[F[_], G[_], A](first: F[A], second: G[A]) { + + /** + * Modify the context `G` of `second` using transformation `f`. + */ + def mapK[H[_]](f: G ~> H): Tuple2K[F, H, A] = + Tuple2K(first, f(second)) + +} object Tuple2K extends Tuple2KInstances diff --git a/core/src/main/scala/cats/data/Validated.scala b/core/src/main/scala/cats/data/Validated.scala index e0b000e8d0..4cc8d56884 100644 --- a/core/src/main/scala/cats/data/Validated.scala +++ b/core/src/main/scala/cats/data/Validated.scala @@ -587,4 +587,18 @@ private[data] trait ValidatedFunctions { * Converts an `Ior[A, B]` to a `Validated[A, B]`. */ def fromIor[A, B](ior: Ior[A, B]): Validated[A, B] = ior.fold(invalid, valid, (_, b) => valid(b)) + + /** + * If the condition is satisfied, return the given `B` as valid, + * otherwise return the given `A` as invalid. + */ + final def cond[A, B](test: Boolean, b: => B, a: => A): Validated[A, B] = + if (test) valid(b) else invalid(a) + + /** + * If the condition is satisfied, return the given `B` as valid NEL, + * otherwise return the given `A` as invalid NEL. + */ + final def condNel[A, B](test: Boolean, b: => B, a: => A): ValidatedNel[A, B] = + if (test) validNel(b) else invalidNel(a) } diff --git a/core/src/main/scala/cats/data/WriterT.scala b/core/src/main/scala/cats/data/WriterT.scala index ee019b1300..61d88444ac 100644 --- a/core/src/main/scala/cats/data/WriterT.scala +++ b/core/src/main/scala/cats/data/WriterT.scala @@ -27,6 +27,12 @@ final case class WriterT[F[_], L, V](run: F[(L, V)]) { functorF.map(run) { z => (z._1, fn(z._2)) } } + /** + * Modify the context `F` using transformation `f`. + */ + def mapK[G[_]](f: F ~> G): WriterT[G, L, V] = + WriterT[G, L, V](f(run)) + def contramap[Z](fn: Z => V)(implicit F: Contravariant[F]): WriterT[F, L, Z] = WriterT { F.contramap(run) { z => (z._1, fn(z._2)) } @@ -118,7 +124,7 @@ private[data] sealed abstract class WriterTInstances1 extends WriterTInstances2 catsDataMonadForWriterT[Id, L] implicit def catsDataEqForWriterT[F[_], L, V](implicit F: Eq[F[(L, V)]]): Eq[WriterT[F, L, V]] = - F.on(_.run) + Eq.by[WriterT[F, L, V], F[(L, V)]](_.run) implicit def catsDataSemigroupForWriterTId[L:Semigroup, V:Semigroup]: Semigroup[WriterT[Id, L, V]] = catsDataSemigroupForWriterT[Id, L, V] diff --git a/core/src/main/scala/cats/instances/eq.scala b/core/src/main/scala/cats/instances/eq.scala index 25ad3b3682..ea392f688b 100644 --- a/core/src/main/scala/cats/instances/eq.scala +++ b/core/src/main/scala/cats/instances/eq.scala @@ -4,8 +4,8 @@ package instances trait EqInstances { implicit val catsContravariantSemigroupalForEq: ContravariantSemigroupal[Eq] = new ContravariantSemigroupal[Eq] { - def contramap[A, B](fa: Eq[A])(fn: B => A): Eq[B] = - fa.on(fn) + def contramap[A, B](fa: Eq[A])(fn: B => A): Eq[B] = Eq.by[B, A](fn)(fa) + def product[A, B](fa: Eq[A], fb: Eq[B]): Eq[(A, B)] = Eq.instance { (left, right) => fa.eqv(left._1, right._1) && fb.eqv(left._2, right._2) } } diff --git a/core/src/main/scala/cats/instances/order.scala b/core/src/main/scala/cats/instances/order.scala index 4dfeafaad4..e0dea80414 100644 --- a/core/src/main/scala/cats/instances/order.scala +++ b/core/src/main/scala/cats/instances/order.scala @@ -9,7 +9,7 @@ trait OrderInstances extends cats.kernel.OrderToOrderingConversion { * * Note: resulting instances are law-abiding only when the functions used are injective (represent a one-to-one mapping) */ - def contramap[A, B](fa: Order[A])(f: B => A): Order[B] = fa.on(f) + def contramap[A, B](fa: Order[A])(f: B => A): Order[B] = Order.by[B, A](f)(fa) def product[A, B](fa: Order[A], fb: Order[B]): Order[(A, B)] = new Order[(A, B)] { diff --git a/core/src/main/scala/cats/instances/partialOrder.scala b/core/src/main/scala/cats/instances/partialOrder.scala index 9ab4c6b75f..671e0b82cf 100644 --- a/core/src/main/scala/cats/instances/partialOrder.scala +++ b/core/src/main/scala/cats/instances/partialOrder.scala @@ -8,7 +8,7 @@ trait PartialOrderInstances { * * Note: resulting instances are law-abiding only when the functions used are injective (represent a one-to-one mapping) */ - def contramap[A, B](fa: PartialOrder[A])(f: B => A): PartialOrder[B] = fa.on(f) + def contramap[A, B](fa: PartialOrder[A])(f: B => A): PartialOrder[B] = PartialOrder.by[B, A](f)(fa) def product[A, B](fa: PartialOrder[A], fb: PartialOrder[B]): PartialOrder[(A, B)] = new PartialOrder[(A, B)] { diff --git a/core/src/main/scala/cats/syntax/foldable.scala b/core/src/main/scala/cats/syntax/foldable.scala index 8c686be4c8..66201f5184 100644 --- a/core/src/main/scala/cats/syntax/foldable.scala +++ b/core/src/main/scala/cats/syntax/foldable.scala @@ -4,6 +4,9 @@ package syntax trait FoldableSyntax extends Foldable.ToFoldableOps with UnorderedFoldable.ToUnorderedFoldableOps { implicit final def catsSyntaxNestedFoldable[F[_]: Foldable, G[_], A](fga: F[G[A]]): NestedFoldableOps[F, G, A] = new NestedFoldableOps[F, G, A](fga) + + implicit final def catsSyntaxFoldOps[F[_]: Foldable, A](fa: F[A]): FoldableOps[F, A] = + new FoldableOps[F, A](fa) } final class NestedFoldableOps[F[_], G[_], A](val fga: F[G[A]]) extends AnyVal { @@ -23,3 +26,11 @@ final class NestedFoldableOps[F[_], G[_], A](val fga: F[G[A]]) extends AnyVal { */ def foldK(implicit F: Foldable[F], G: MonoidK[G]): G[A] = F.foldK(fga) } + +final class FoldableOps[F[_], A](val fa: F[A]) extends AnyVal { + def foldl[B](b: B)(f: (B, A) => B)(implicit F: Foldable[F]): B = + F.foldLeft(fa, b)(f) + + def foldr[B](b: Eval[B])(f: (A, Eval[B]) => Eval[B])(implicit F: Foldable[F]): Eval[B] = + F.foldRight(fa, b)(f) +} diff --git a/docs/src/main/tut/datatypes/const.md b/docs/src/main/tut/datatypes/const.md index d047303a30..39d4caa420 100644 --- a/docs/src/main/tut/datatypes/const.md +++ b/docs/src/main/tut/datatypes/const.md @@ -29,7 +29,7 @@ Because the second type parameter is not used in the data type, the type paramet ## Why do we care? It would seem `Const` gives us no benefit over a data type that would simply not have the second type parameter. -However, while we don't directly use the second type parameter, it's existence becomes useful in certain contexts. +However, while we don't directly use the second type parameter, its existence becomes useful in certain contexts. ### Example 1: Lens The following is heavily inspired by [Julien Truffaut](https://github.com/julien-truffaut)'s diff --git a/docs/src/main/tut/datatypes/kleisli.md b/docs/src/main/tut/datatypes/kleisli.md index ad5108e9c8..27923024af 100644 --- a/docs/src/main/tut/datatypes/kleisli.md +++ b/docs/src/main/tut/datatypes/kleisli.md @@ -56,7 +56,7 @@ The output type of `parse` is `Option[Int]` whereas the input type of `reciproca This is where `Kleisli` comes into play. ## Kleisli -At it's core, `Kleisli[F[_], A, B]` is just a wrapper around the function `A => F[B]`. Depending on the +At its core, `Kleisli[F[_], A, B]` is just a wrapper around the function `A => F[B]`. Depending on the properties of the `F[_]`, we can do different things with `Kleisli`s. For instance, if `F[_]` has a `FlatMap[F]` instance (we can call `flatMap` on `F[A]` values), we can compose two `Kleisli`s much like we can two functions. @@ -215,7 +215,7 @@ Functional programming advocates the creation of programs and modules by composi philosophy intentionally mirrors that of function composition - write many small functions, and compose them to build larger ones. After all, our programs are just functions. -Let's look at some example modules, where each module has it's own configuration that is validated by a function. +Let's look at some example modules, where each module has its own configuration that is validated by a function. If the configuration is good, we return a `Some` of the module, otherwise a `None`. This example uses `Option` for simplicity - if you want to provide error messages or other failure context, consider using `Either` instead. diff --git a/docs/src/main/tut/typeclasses/imports.md b/docs/src/main/tut/typeclasses/imports.md index 8e4c38fe01..43bcb16b12 100644 --- a/docs/src/main/tut/typeclasses/imports.md +++ b/docs/src/main/tut/typeclasses/imports.md @@ -53,7 +53,7 @@ The first import pulls the `Semigroup` instance for String into the scope, while You can also import all syntax or all instances by importing `cats.syntax.all._` or `cats.instances.all._` respectively. For data types included in cats (i.e. data structure from the `cats.data` package), all type class instances are bundled with their implementation and therefore do not need to be imported separately. -For example, if we wanted to import `NonEmptyList` from the `cats.data` package and use it's `SemigroupK` instance, we would not need to specifically import the instance: +For example, if we wanted to import `NonEmptyList` from the `cats.data` package and use its `SemigroupK` instance, we would not need to specifically import the instance: ```tut:book import cats.data.NonEmptyList diff --git a/docs/src/main/tut/typeclasses/invariantmonoidal.md b/docs/src/main/tut/typeclasses/invariantmonoidal.md index c238f359bc..a8fdb49c4e 100644 --- a/docs/src/main/tut/typeclasses/invariantmonoidal.md +++ b/docs/src/main/tut/typeclasses/invariantmonoidal.md @@ -189,7 +189,7 @@ fooCodec.read(fooCodec.write(foo)) == ((Some(foo), List())) # `InvariantMonoidal` as a generalization of `Invariant` -To better understand the motivations behind the `InvariantMonoidal` type class, we show how one could naturally arrive to it's definition by generalizing the concept of `Invariant` functor. This reflection is analogous to the one presented in [Free Applicative Functors by Paolo Capriotti](http://www.paolocapriotti.com/assets/applicative.pdf) to show how [`Applicative`](applicative.html) are a generalization of [`Functor`](functor.html). +To better understand the motivations behind the `InvariantMonoidal` type class, we show how one could naturally arrive to its definition by generalizing the concept of `Invariant` functor. This reflection is analogous to the one presented in [Free Applicative Functors by Paolo Capriotti](http://www.paolocapriotti.com/assets/applicative.pdf) to show how [`Applicative`](applicative.html) are a generalization of [`Functor`](functor.html). Given an `Invariant[F]` instance for a certain *context* `F[_]`, its `imap` method gives a way to lift two *unary* pure functions `A => B` and `B => A` into *contextualized* functions `F[A] => F[B]`. But what about functions of other arity? diff --git a/free/src/main/scala/cats/free/Coyoneda.scala b/free/src/main/scala/cats/free/Coyoneda.scala index 58e3b722f6..d1d9de4019 100644 --- a/free/src/main/scala/cats/free/Coyoneda.scala +++ b/free/src/main/scala/cats/free/Coyoneda.scala @@ -46,9 +46,16 @@ sealed abstract class Coyoneda[F[_], A] extends Serializable { self => final def map[B](f: A => B): Aux[F, B, Pivot] = unsafeApply(fi)(f.asInstanceOf[Any => Any] :: ks) - final def transform[G[_]](f: FunctionK[F, G]): Aux[G, A, Pivot] = + /** + * Modify the context `F` using transformation `f`. + */ + final def mapK[G[_]](f: F ~> G): Aux[G, A, Pivot] = unsafeApply(f(fi))(ks) + @deprecated("Use mapK", "1.0.0") + final def transform[G[_]](f: FunctionK[F, G]): Aux[G, A, Pivot] = + mapK(f) + } object Coyoneda { diff --git a/free/src/main/scala/cats/free/Free.scala b/free/src/main/scala/cats/free/Free.scala index b07127b180..b1d7ed956f 100644 --- a/free/src/main/scala/cats/free/Free.scala +++ b/free/src/main/scala/cats/free/Free.scala @@ -17,6 +17,21 @@ sealed abstract class Free[S[_], A] extends Product with Serializable { final def map[B](f: A => B): Free[S, B] = flatMap(a => Pure(f(a))) + /** + * Modify the functor context `S` using transformation `f`. + * + * This is effectively compiling your free monad into another + * language by changing the suspension functor using the given + * natural transformation `f`. + * + * If your natural transformation is effectful, be careful. These + * effects will be applied by `mapK`. + */ + final def mapK[T[_]](f: S ~> T): Free[T, A] = + foldMap[Free[T, ?]] { // this is safe because Free is stack safe + λ[FunctionK[S, Free[T, ?]]](fa => Suspend(f(fa))) + }(Free.catsFreeMonadForFree) + /** * Bind the given continuation to the result of this computation. * All left-associated binds are reassociated to the right. @@ -147,11 +162,8 @@ sealed abstract class Free[S[_], A] extends Product with Serializable { * * If your natural transformation is effectful, be careful. These * effects will be applied by `compile`. - */ - final def compile[T[_]](f: FunctionK[S, T]): Free[T, A] = - foldMap[Free[T, ?]] { // this is safe because Free is stack safe - λ[FunctionK[S, Free[T, ?]]](fa => Suspend(f(fa))) - }(Free.catsFreeMonadForFree) + */ + final def compile[T[_]](f: FunctionK[S, T]): Free[T, A] = mapK(f) /** * Lift into `G` (typically a `EitherK`) given `InjectK`. Analogous @@ -169,7 +181,7 @@ sealed abstract class Free[S[_], A] extends Product with Serializable { *}}} */ final def inject[G[_]](implicit ev: InjectK[S, G]): Free[G, A] = - compile(λ[S ~> G](ev.inj(_))) + mapK(λ[S ~> G](ev.inj(_))) override def toString: String = "Free(...)" @@ -217,11 +229,17 @@ object Free extends FreeInstances { def defer[F[_], A](value: => Free[F, A]): Free[F, A] = pure(()).flatMap(_ => value) + /** + * a FunctionK, suitable for composition, which calls mapK + */ + def mapK[F[_], G[_]](fk: FunctionK[F, G]): FunctionK[Free[F, ?], Free[G, ?]] = + λ[FunctionK[Free[F, ?], Free[G, ?]]](f => f.mapK(fk)) + /** * a FunctionK, suitable for composition, which calls compile */ def compile[F[_], G[_]](fk: FunctionK[F, G]): FunctionK[Free[F, ?], Free[G, ?]] = - λ[FunctionK[Free[F, ?], Free[G, ?]]](f => f.compile(fk)) + mapK(fk) /** * a FunctionK, suitable for composition, which calls foldMap diff --git a/free/src/main/scala/cats/free/FreeT.scala b/free/src/main/scala/cats/free/FreeT.scala index 630d7f0a33..ea4fb05262 100644 --- a/free/src/main/scala/cats/free/FreeT.scala +++ b/free/src/main/scala/cats/free/FreeT.scala @@ -21,6 +21,17 @@ sealed abstract class FreeT[S[_], M[_], A] extends Product with Serializable { final def map[B](f: A => B)(implicit M: Applicative[M]): FreeT[S, M, B] = flatMap(a => pure(f(a))) + /** + * Modify the context `M` using transformation `mn`. + */ + def mapK[N[_]](mn: M ~> N): FreeT[S, N, A] = + step match { + case e @ FlatMapped(_, _) => + FlatMapped(e.a.mapK(mn), e.f.andThen(_.mapK(mn))) + case Suspend(m) => + Suspend(mn(m)) + } + /** Binds the given continuation to the result of this computation. */ final def flatMap[B](f: A => FreeT[S, M, B]): FreeT[S, M, B] = FlatMapped(this, f) @@ -28,14 +39,9 @@ sealed abstract class FreeT[S[_], M[_], A] extends Product with Serializable { /** * Changes the underlying `Monad` for this `FreeT`, ie. * turning this `FreeT[S, M, A]` into a `FreeT[S, N, A]`. - */ + */ def hoist[N[_]](mn: FunctionK[M, N]): FreeT[S, N, A] = - step match { - case e @ FlatMapped(_, _) => - FlatMapped(e.a.hoist(mn), e.f.andThen(_.hoist(mn))) - case Suspend(m) => - Suspend(mn(m)) - } + mapK(mn) @deprecated("Use compile", "0.8.0") def interpret[T[_]](st: FunctionK[S, T])(implicit M: Functor[M]): FreeT[T, M, A] = compile(st) @@ -251,4 +257,3 @@ private[free] sealed trait FreeTSemigroupK[S[_], M[_]] extends SemigroupK[FreeT[ override final def combineK[A](a: FreeT[S, M, A], b: FreeT[S, M, A]): FreeT[S, M, A] = FreeT.liftT(M1.combineK(a.toM, b.toM))(M).flatMap(identity) } - diff --git a/free/src/main/scala/cats/free/Yoneda.scala b/free/src/main/scala/cats/free/Yoneda.scala index 2e9e468081..841435b7f4 100644 --- a/free/src/main/scala/cats/free/Yoneda.scala +++ b/free/src/main/scala/cats/free/Yoneda.scala @@ -28,6 +28,14 @@ abstract class Yoneda[F[_], A] extends Serializable { self => new Yoneda[F, B] { def apply[C](g: B => C): F[C] = self(f andThen g) } + + /** + * Modify the context `F` using transformation `f`. + */ + def mapK[G[_]](f: F ~> G): Yoneda[G, A] = + new Yoneda[G, A] { + def apply[B](g: A => B): G[B] = f(self(g)) + } } object Yoneda { @@ -48,4 +56,3 @@ object Yoneda { def apply[B](f: A => B): F[B] = F.map(fa)(f) } } - diff --git a/free/src/test/scala/cats/free/CoyonedaSuite.scala b/free/src/test/scala/cats/free/CoyonedaSuite.scala index 17e61ea4ce..89dcd9fc6d 100644 --- a/free/src/test/scala/cats/free/CoyonedaSuite.scala +++ b/free/src/test/scala/cats/free/CoyonedaSuite.scala @@ -25,11 +25,11 @@ class CoyonedaSuite extends CatsSuite { } } - test("transform and run is same as applying natural trans") { + test("mapK and run is same as applying natural trans") { val nt = λ[FunctionK[Option, List]](_.toList) val o = Option("hello") val c = Coyoneda.lift(o) - c.transform(nt).run should === (nt(o)) + c.mapK(nt).run should === (nt(o)) } test("map order") { diff --git a/free/src/test/scala/cats/free/FreeTSuite.scala b/free/src/test/scala/cats/free/FreeTSuite.scala index d604021fe8..36e5e07df1 100644 --- a/free/src/test/scala/cats/free/FreeTSuite.scala +++ b/free/src/test/scala/cats/free/FreeTSuite.scala @@ -76,18 +76,18 @@ class FreeTSuite extends CatsSuite { Eq[FreeTOption[Unit]].eqv(expected, result) should ===(true) } - test("hoist to universal id equivalent to original instance") { + test("mapK to universal id equivalent to original instance") { forAll { a: FreeTOption[Int] => - val b = a.hoist(FunctionK.id) + val b = a.mapK(FunctionK.id) Eq[FreeTOption[Int]].eqv(a, b) should ===(true) } } - test("hoist stack-safety") { + test("mapK stack-safety") { val a = (0 until 50000).foldLeft(Applicative[FreeTOption].pure(()))( (fu, i) => fu.flatMap(u => Applicative[FreeTOption].pure(u)) ) - val b = a.hoist(FunctionK.id) + val b = a.mapK(FunctionK.id) } test("compile to universal id equivalent to original instance") { diff --git a/js/src/test/scala/cats/tests/FutureTests.scala b/js/src/test/scala/cats/tests/FutureTests.scala index 1fd1829b0e..7cac7bfefb 100644 --- a/js/src/test/scala/cats/tests/FutureTests.scala +++ b/js/src/test/scala/cats/tests/FutureTests.scala @@ -38,7 +38,7 @@ class FutureTests extends CatsSuite { } implicit val throwableEq: Eq[Throwable] = - Eq[String].on(_.toString) + Eq.by[Throwable, String](_.toString) implicit val comonad: Comonad[Future] = futureComonad(timeout) diff --git a/jvm/src/test/scala/cats/tests/FutureSuite.scala b/jvm/src/test/scala/cats/tests/FutureSuite.scala index 24af2df9d4..d60a73f1f5 100644 --- a/jvm/src/test/scala/cats/tests/FutureSuite.scala +++ b/jvm/src/test/scala/cats/tests/FutureSuite.scala @@ -32,7 +32,7 @@ class FutureSuite extends CatsSuite { Cogen[Future[A]] { (seed: Seed, t: Future[A]) => Cogen[A].perturb(seed, Await.result(t, timeout)) } implicit val throwableEq: Eq[Throwable] = - Eq[String].on(_.toString) + Eq.by[Throwable, String](_.toString) // Need non-fatal Throwables for Future recoverWith/handleError implicit val nonFatalArbitrary: Arbitrary[Throwable] = diff --git a/kernel-laws/src/main/scala/cats/kernel/laws/SemigroupLaws.scala b/kernel-laws/src/main/scala/cats/kernel/laws/SemigroupLaws.scala index 6c290b6ac8..52265cbb54 100644 --- a/kernel-laws/src/main/scala/cats/kernel/laws/SemigroupLaws.scala +++ b/kernel-laws/src/main/scala/cats/kernel/laws/SemigroupLaws.scala @@ -8,10 +8,10 @@ trait SemigroupLaws[A] { def semigroupAssociative(x: A, y: A, z: A): IsEq[A] = S.combine(S.combine(x, y), z) <-> S.combine(x, S.combine(y, z)) - def repeat1(a: A, i: Int): IsEq[A] = + def repeat1(a: A): IsEq[A] = S.combineN(a, 1) <-> a - def repeat2(a: A, i: Int): IsEq[A] = + def repeat2(a: A): IsEq[A] = S.combineN(a, 2) <-> S.combine(a, a) def combineAllOption(xs: Vector[A]): IsEq[Option[A]] = diff --git a/kernel-laws/src/main/scala/cats/kernel/laws/discipline/package.scala b/kernel-laws/src/main/scala/cats/kernel/laws/discipline/package.scala index f5b0239b3b..c96cafc65d 100644 --- a/kernel-laws/src/main/scala/cats/kernel/laws/discipline/package.scala +++ b/kernel-laws/src/main/scala/cats/kernel/laws/discipline/package.scala @@ -4,6 +4,6 @@ import cats.kernel.Eq import org.scalacheck.Prop package object discipline { - implicit def catsLawsIsEqToProp[A: Eq](isEq: IsEq[A])(implicit ev: Eq[A]): Prop = + implicit def catsLawsIsEqToProp[A](isEq: IsEq[A])(implicit ev: Eq[A]): Prop = ev.eqv(isEq.lhs, isEq.rhs) } diff --git a/kernel-laws/src/test/scala/cats/kernel/laws/LawTests.scala b/kernel-laws/src/test/scala/cats/kernel/laws/LawTests.scala index 1a8d704dce..96359bbdf8 100644 --- a/kernel-laws/src/test/scala/cats/kernel/laws/LawTests.scala +++ b/kernel-laws/src/test/scala/cats/kernel/laws/LawTests.scala @@ -94,7 +94,7 @@ class Tests extends FunSuite with Discipline { { // needed for Cogen[Map[...]] - implicit val ohe: Ordering[HasEq[Int]] = Ordering[Int].on(_.a) + implicit val ohe: Ordering[HasEq[Int]] = Ordering.by[HasEq[Int], Int](_.a) checkAll("Eq[Map[String, HasEq[Int]]]", EqTests[Map[String, HasEq[Int]]].eqv) } @@ -106,8 +106,8 @@ class Tests extends FunSuite with Discipline { checkAll("Eq[Queue[HasEq[Int]]]", EqTests[Queue[HasEq[Int]]].eqv) checkAll("PartialOrder[Set[Int]]", PartialOrderTests[Set[Int]].partialOrder) - checkAll("PartialOrder[Set[Int]].reverse", PartialOrderTests(PartialOrder[Set[Int]].reverse).partialOrder) - checkAll("PartialOrder[Set[Int]].reverse.reverse", PartialOrderTests(PartialOrder[Set[Int]].reverse.reverse).partialOrder) + checkAll("PartialOrder.reverse(PartialOrder[Set[Int]])", PartialOrderTests(PartialOrder.reverse(PartialOrder[Set[Int]])).partialOrder) + checkAll("PartialOrder.reverse(PartialOrder.reverse(PartialOrder[Set[Int]]))", PartialOrderTests(PartialOrder.reverse(PartialOrder.reverse(PartialOrder[Set[Int]]))).partialOrder) checkAll("PartialOrder[Option[HasPartialOrder[Int]]]", PartialOrderTests[Option[HasPartialOrder[Int]]].partialOrder) checkAll("PartialOrder[List[HasPartialOrder[Int]]]", PartialOrderTests[List[HasPartialOrder[Int]]].partialOrder) checkAll("PartialOrder[Vector[HasPartialOrder[Int]]]", PartialOrderTests[Vector[HasPartialOrder[Int]]].partialOrder) @@ -136,8 +136,8 @@ class Tests extends FunSuite with Discipline { checkAll("Order[Stream[Int]]", OrderTests[Stream[Int]].order) checkAll("Order[Queue[Int]]", OrderTests[Queue[Int]].order) checkAll("fromOrdering[Int]", OrderTests(Order.fromOrdering[Int]).order) - checkAll("Order[Int].reverse", OrderTests(Order[Int].reverse).order) - checkAll("Order[Int].reverse.reverse", OrderTests(Order[Int].reverse.reverse).order) + checkAll("Order.reverse(Order[Int])", OrderTests(Order.reverse(Order[Int])).order) + checkAll("Order.reverse(Order.reverse(Order[Int]))", OrderTests(Order.reverse(Order.reverse(Order[Int]))).order) checkAll("Monoid[String]", MonoidTests[String].monoid) checkAll("Monoid[String]", SerializableTests.serializable(Monoid[String])) @@ -343,7 +343,7 @@ class Tests extends FunSuite with Discipline { object HasEq { implicit def hasEq[A: Eq]: Eq[HasEq[A]] = - Eq[A].on(_.a) + Eq.by(_.a) implicit def hasEqArbitrary[A: Arbitrary]: Arbitrary[HasEq[A]] = Arbitrary(arbitrary[A].map(HasEq(_))) implicit def hasCogen[A: Cogen]: Cogen[HasEq[A]] = @@ -354,7 +354,7 @@ class Tests extends FunSuite with Discipline { object HasPartialOrder { implicit def hasPartialOrder[A: PartialOrder]: PartialOrder[HasPartialOrder[A]] = - PartialOrder[A].on(_.a) + PartialOrder.by(_.a) implicit def hasPartialOrderArbitrary[A: Arbitrary]: Arbitrary[HasPartialOrder[A]] = Arbitrary(arbitrary[A].map(HasPartialOrder(_))) implicit def hasCogen[A: Cogen]: Cogen[HasPartialOrder[A]] = @@ -365,7 +365,7 @@ class Tests extends FunSuite with Discipline { object HasHash { implicit def hasHash[A: Hash]: Hash[HasHash[A]] = - Hash.by(_.a) // not Hash[A].on(_.a) because of diamond inheritance problems with Eq + Hash.by(_.a) implicit def hasHashArbitrary[A: Arbitrary]: Arbitrary[HasHash[A]] = Arbitrary(arbitrary[A].map(HasHash(_))) implicit def hasCogen[A: Cogen]: Cogen[HasHash[A]] = diff --git a/kernel/src/main/scala/cats/kernel/Eq.scala b/kernel/src/main/scala/cats/kernel/Eq.scala index 4a25cbbab7..227937c632 100644 --- a/kernel/src/main/scala/cats/kernel/Eq.scala +++ b/kernel/src/main/scala/cats/kernel/Eq.scala @@ -20,32 +20,6 @@ trait Eq[@sp A] extends Any with Serializable { self => * Returns `false` if `x` and `y` are equivalent, `true` otherwise. */ def neqv(x: A, y: A): Boolean = !eqv(x, y) - - /** - * Constructs a new `Eq` instance for type `B` where 2 elements are - * equivalent iff `eqv(f(x), f(y))`. - */ - def on[@sp B](f: B => A): Eq[B] = - new Eq[B] { - def eqv(x: B, y: B): Boolean = self.eqv(f(x), f(y)) - } - - /** - * Return an Eq that gives the result of the and of this and that - * note this is idempotent - */ - def and(that: Eq[A]): Eq[A] = - new Eq[A] { - def eqv(x: A, y: A) = self.eqv(x, y) && that.eqv(x, y) - } - /** - * Return an Eq that gives the result of the or of this and that - * Note this is idempotent - */ - def or(that: Eq[A]): Eq[A] = - new Eq[A] { - def eqv(x: A, y: A) = self.eqv(x, y) || that.eqv(x, y) - } } abstract class EqFunctions[E[T] <: Eq[T]] { @@ -70,7 +44,27 @@ object Eq extends EqFunctions[Eq] { * function `f`. */ def by[@sp A, @sp B](f: A => B)(implicit ev: Eq[B]): Eq[A] = - ev.on(f) + new Eq[A] { + def eqv(x: A, y: A) = ev.eqv(f(x), f(y)) + } + + /** + * Return an Eq that gives the result of the and of eq1 and eq2 + * note this is idempotent + */ + def and[@sp A](eq1: Eq[A], eq2: Eq[A]): Eq[A] = + new Eq[A] { + def eqv(x: A, y: A) = eq1.eqv(x, y) && eq2.eqv(x, y) + } + + /** + * Return an Eq that gives the result of the or of this and that + * Note this is idempotent + */ + def or[@sp A](eq1: Eq[A], eq2: Eq[A]): Eq[A] = + new Eq[A] { + def eqv(x: A, y: A) = eq1.eqv(x, y) || eq2.eqv(x, y) + } /** * This gives compatibility with scala's Equiv trait @@ -112,7 +106,7 @@ object Eq extends EqFunctions[Eq] { */ def allEqualBoundedSemilattice[A]: BoundedSemilattice[Eq[A]] = new BoundedSemilattice[Eq[A]] { def empty = allEqual[A] - def combine(e1: Eq[A], e2: Eq[A]): Eq[A] = e1.and(e2) + def combine(e1: Eq[A], e2: Eq[A]): Eq[A] = Eq.and(e1, e2) override def combineAllOption(es: TraversableOnce[Eq[A]]): Option[Eq[A]] = if (es.isEmpty) None else { @@ -128,7 +122,7 @@ object Eq extends EqFunctions[Eq] { * checks that at least one equality check passes */ def anyEqualSemilattice[A]: Semilattice[Eq[A]] = new Semilattice[Eq[A]] { - def combine(e1: Eq[A], e2: Eq[A]): Eq[A] = e1.or(e2) + def combine(e1: Eq[A], e2: Eq[A]): Eq[A] = Eq.or(e1, e2) override def combineAllOption(es: TraversableOnce[Eq[A]]): Option[Eq[A]] = if (es.isEmpty) None else { diff --git a/kernel/src/main/scala/cats/kernel/Hash.scala b/kernel/src/main/scala/cats/kernel/Hash.scala index 19db76bfa8..ef8e88d742 100644 --- a/kernel/src/main/scala/cats/kernel/Hash.scala +++ b/kernel/src/main/scala/cats/kernel/Hash.scala @@ -16,9 +16,6 @@ trait Hash[@sp A] extends Any with Eq[A] with Serializable { self => */ def hash(x: A): Int - // `Hash#on` deliberately not implemented to avoid `Hash`/`Order` diamond inheritance problem. - // Please use `Hash.by` for the same functionality. - // `Hash#toHashing` deliberately not implemented since `scala.util.hashing.Hashing` is only // compatible with universal equality. } diff --git a/kernel/src/main/scala/cats/kernel/Order.scala b/kernel/src/main/scala/cats/kernel/Order.scala index 0292866718..daeb603336 100644 --- a/kernel/src/main/scala/cats/kernel/Order.scala +++ b/kernel/src/main/scala/cats/kernel/Order.scala @@ -46,25 +46,6 @@ trait Order[@sp A] extends Any with PartialOrder[A] { self => */ def max(x: A, y: A): A = if (gt(x, y)) x else y - /** - * Defines an order on `B` by mapping `B` to `A` using `f` and using `A`s - * order to order `B`. - */ - override def on[@sp B](f: B => A): Order[B] = - new Order[B] { - def compare(x: B, y: B): Int = self.compare(f(x), f(y)) - } - - /** - * Defines an ordering on `A` where all arrows switch direction. - */ - override def reverse: Order[A] = - new Order[A] { - def compare(x: A, y: A): Int = self.compare(y, x) - - override def reverse: Order[A] = self - } - // The following may be overridden for performance: /** @@ -103,21 +84,6 @@ trait Order[@sp A] extends Any with PartialOrder[A] { self => override def gt(x: A, y: A): Boolean = compare(x, y) > 0 - /** - * Returns a new `Order[A]` instance that first compares by the original - * `Order` instance and uses the provided `Order` instance to "break ties". - * - * That is, `x.whenEqual(y)` creates an `Order` that first orders by `x` and - * then (if two elements are equal) falls back to `y` for the comparison. - */ - def whenEqual(o: Order[A]): Order[A] = new Order[A] { - def compare(x: A, y: A) = { - val c = self.compare(x, y) - if (c == 0) o.compare(x, y) - else c - } - } - /** * Convert a `Order[A]` to a `scala.math.Ordering[A]` * instance. @@ -159,7 +125,33 @@ object Order extends OrderFunctions[Order] { * function `f`. */ def by[@sp A, @sp B](f: A => B)(implicit ev: Order[B]): Order[A] = - ev.on(f) + new Order[A] { + def compare(x: A, y: A): Int = ev.compare(f(x), f(y)) + } + + /** + * Defines an ordering on `A` from the given order such that all arrows switch direction. + */ + def reverse[@sp A](order: Order[A]): Order[A] = + new Order[A] { + def compare(x: A, y: A): Int = order.compare(y, x) + } + + /** + * Returns a new `Order[A]` instance that first compares by the first + * `Order` instance and uses the second `Order` instance to "break ties". + * + * That is, `Order.whenEqual(x, y)` creates an `Order` that first orders by `x` and + * then (if two elements are equal) falls back to `y` for the comparison. + */ + def whenEqual[@sp A](first: Order[A], second: Order[A]): Order[A] = + new Order[A] { + def compare(x: A, y: A) = { + val c = first.compare(x, y) + if (c == 0) second.compare(x, y) + else c + } + } /** * Define an `Order[A]` using the given function `f`. @@ -184,7 +176,6 @@ object Order extends OrderFunctions[Order] { def compare(x: A, y: A): Int = 0 } - /** * A `Monoid[Order[A]]` can be generated for all `A` with the following * properties: @@ -203,7 +194,7 @@ object Order extends OrderFunctions[Order] { def whenEqualMonoid[A]: Monoid[Order[A]] with Band[Order[A]] = new Monoid[Order[A]] with Band[Order[A]] { val empty: Order[A] = allEqual[A] - def combine(x: Order[A], y: Order[A]): Order[A] = x whenEqual y + def combine(x: Order[A], y: Order[A]): Order[A] = Order.whenEqual(x, y) } def fromOrdering[A](implicit ev: Ordering[A]): Order[A] = diff --git a/kernel/src/main/scala/cats/kernel/PartialOrder.scala b/kernel/src/main/scala/cats/kernel/PartialOrder.scala index 7a56eeabf8..048041b0f1 100644 --- a/kernel/src/main/scala/cats/kernel/PartialOrder.scala +++ b/kernel/src/main/scala/cats/kernel/PartialOrder.scala @@ -73,25 +73,6 @@ trait PartialOrder[@sp A] extends Any with Eq[A] { self => else None } - /** - * Defines a partial order on `B` by mapping `B` to `A` using `f` - * and using `A`s order to order `B`. - */ - override def on[@sp B](f: B => A): PartialOrder[B] = - new PartialOrder[B] { - def partialCompare(x: B, y: B): Double = self.partialCompare(f(x), f(y)) - } - - /** - * Defines a partial order on `A` where all arrows switch direction. - */ - def reverse: PartialOrder[A] = - new PartialOrder[A] { - def partialCompare(x: A, y: A): Double = self.partialCompare(y, x) - - override def reverse: PartialOrder[A] = self - } - // The following may be overridden for performance: /** @@ -153,7 +134,17 @@ object PartialOrder extends PartialOrderFunctions[PartialOrder] { * function `f`. */ def by[@sp A, @sp B](f: A => B)(implicit ev: PartialOrder[B]): PartialOrder[A] = - ev.on(f) + new PartialOrder[A] { + def partialCompare(x: A, y: A): Double = ev.partialCompare(f(x), f(y)) + } + + /** + * Defines a partial order on `A` from p where all arrows switch direction. + */ + def reverse[@sp A](p: PartialOrder[A]): PartialOrder[A] = + new PartialOrder[A] { + def partialCompare(x: A, y: A): Double = p.partialCompare(y, x) + } /** * Define a `PartialOrder[A]` using the given function `f`. diff --git a/laws/src/main/scala/cats/laws/discipline/Eq.scala b/laws/src/main/scala/cats/laws/discipline/Eq.scala index 082556f62b..13f495b29a 100644 --- a/laws/src/main/scala/cats/laws/discipline/Eq.scala +++ b/laws/src/main/scala/cats/laws/discipline/Eq.scala @@ -101,25 +101,25 @@ object eq { * Create an approximation of Eq[Semigroup[A]] by generating values for A * and comparing the application of the two combine functions. */ - implicit def catsLawsEqForSemigroup[A](implicit arbAA: Arbitrary[(A, A)], eqA: Eq[A]): Eq[Semigroup[A]] = - catsLawsEqForFn1[(A, A), A].on(f => - Function.tupled((x, y) => f.combine(x, y)) - ) + implicit def catsLawsEqForSemigroup[A](implicit arbAA: Arbitrary[(A, A)], eqA: Eq[A]): Eq[Semigroup[A]] = { + val instance: Eq[((A, A)) => A] = catsLawsEqForFn1[(A, A), A] + Eq.by[Semigroup[A], ((A, A)) => A]( f => Function.tupled((x, y) => f.combine(x, y)))(instance) + } implicit def catsLawsEqForCommutativeSemigroup[A](implicit arbAA: Arbitrary[(A, A)], eqA: Eq[A]): Eq[CommutativeSemigroup[A]] = { implicit val eqABool: Eq[(A, Boolean)] = Eq.instance { case ((x, boolX), (y, boolY)) => x === y && boolX === boolY } - catsLawsEqForFn1[(A, A), (A, Boolean)].on(f => + Eq.by[CommutativeSemigroup[A], ((A, A)) => (A, Boolean)](f => Function.tupled((x, y) => (f.combine(x, y), f.combine(x, y) === f.combine(y, x))) - ) + )(catsLawsEqForFn1[(A, A), (A, Boolean)]) } implicit def catsLawsEqForBand[A](implicit arbAA: Arbitrary[(A, A)], eqSA: Eq[Semigroup[A]], eqA: Eq[A]): Eq[Band[A]] = { - catsLawsEqForFn1[(A, A), Boolean].on(f => + Eq.by[Band[A], ((A, A)) => Boolean](f => Function.tupled((x, y) => f.combine(x, y) === f.combine(f.combine(x, y), y)) - ) + )(catsLawsEqForFn1[(A, A), Boolean]) } implicit def catsLawsEqForMonoid[A](implicit eqSA: Eq[Semigroup[A]], eqA: Eq[A]): Eq[Monoid[A]] = new Eq[Monoid[A]] { @@ -142,14 +142,14 @@ object eq { case ((x, boolX), (y, boolY)) => x === y && boolX === boolY } - val inverseEq = catsLawsEqForFn1[(A, A), (A, Boolean)].on[Group[A]](f => + val inverseEq = Eq.by[Group[A], ((A, A)) => (A, Boolean)](f => Function.tupled((x, y) => ( f.combine(x, y), f.combine(f.inverse(x), x) === f.empty && f.combine(x, f.inverse(x)) === f.empty && f.combine(f.inverse(y), y) === f.empty && f.combine(y, f.inverse(y)) === f.empty && f.inverse(f.empty) == f.empty ) - )) + ))(catsLawsEqForFn1[(A, A), (A, Boolean)]) Eq.instance((f, g) => eqMA.eqv(f, g) && inverseEq.eqv(f, g)) } diff --git a/scalafix/README.md b/scalafix/README.md index 179ffe1a0e..33a7e29740 100644 --- a/scalafix/README.md +++ b/scalafix/README.md @@ -2,16 +2,12 @@ ## Try this! -Install the scalafix sbt plugin (globally or in a specific project): +[Install the scalafix sbt plugin](https://scalacenter.github.io/scalafix/docs/users/installation) -```scala -addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.5.0-RC2") -``` - -to run all rules that apply to version `1.0.0-MF` run +To run all rules that apply to version `1.0.0-RC1` run ```sh -sbt scalafix github:typelevel/cats/v1.0.0?sha=c131fe4 +sbt scalafix github:typelevel/cats/v1.0.0?sha=v1.0.0-RC1 ``` to run all rules that apply to the current `1.0.0-SNAPSHOT` run @@ -39,6 +35,7 @@ sbt scalafix github:typelevel/cats/v1.0.0 - [x] Apply syntax on tuple (e.g. (x, y, z).map3(...)) was moved from cats.syntax.tuple._ to cats.syntax.apply._ and renamed to mapN, contramapN and imapN respectively. - [x] Split is removed, and the method split is moved to Arrow. Note that only under CommutativeArrow does it guarantee the non-interference between the effects. see #1567 + # WIP - [ ] cats no longer publishes the all-inclusive bundle package "org.typelevel" % "cats", use cats-core, cats-free, or cats-law accordingly instead. If you need cats.free, use "org.typelevel" % "cats-free", if you need cats-laws use "org.typelevel" % "cats-laws", if neither, use "org.typelevel" % "cats-core". diff --git a/tests/src/test/scala/cats/tests/CsvCodecInvariantMonoidalSuite.scala b/tests/src/test/scala/cats/tests/CsvCodecInvariantMonoidalSuite.scala index e75d0be86d..37d0a3b0ec 100644 --- a/tests/src/test/scala/cats/tests/CsvCodecInvariantMonoidalSuite.scala +++ b/tests/src/test/scala/cats/tests/CsvCodecInvariantMonoidalSuite.scala @@ -79,8 +79,11 @@ object CsvCodecInvariantMonoidalSuite { implicit val arbNumericSystemCodec: Arbitrary[CsvCodec[Int]] = Arbitrary(Gen.choose(2, 16).map(numericSystemCodec)) - implicit def csvCodecsEq[A](implicit a: Arbitrary[A], e: Eq[A]): Eq[CsvCodec[A]] = - catsLawsEqForFn1[A, CSV].on[CsvCodec[A]](_.write) and catsLawsEqForFn1[CSV, (Option[A], CSV)].on[CsvCodec[A]](_.read) + implicit def csvCodecsEq[A](implicit a: Arbitrary[A], e: Eq[A]): Eq[CsvCodec[A]] = { + val writeEq: Eq[CsvCodec[A]] = Eq.by[CsvCodec[A], A => CSV](_.write)(catsLawsEqForFn1[A, CSV]) + val readEq: Eq[CsvCodec[A]] = Eq.by[CsvCodec[A], CSV => (Option[A], CSV)](_.read)(catsLawsEqForFn1[CSV, (Option[A], CSV)]) + Eq.and(writeEq, readEq) + } } class CsvCodecInvariantMonoidalSuite extends CatsSuite { diff --git a/tests/src/test/scala/cats/tests/EitherTSuite.scala b/tests/src/test/scala/cats/tests/EitherTSuite.scala index 9fa74fb280..8b84f02646 100644 --- a/tests/src/test/scala/cats/tests/EitherTSuite.scala +++ b/tests/src/test/scala/cats/tests/EitherTSuite.scala @@ -242,6 +242,13 @@ class EitherTSuite extends CatsSuite { } } + test("mapK consistent with f(value)+pure") { + val f: List ~> Option = λ[List ~> Option](_.headOption) + forAll { (eithert: EitherT[List, String, Int]) => + eithert.mapK(f) should === (EitherT(f(eithert.value))) + } + } + test("semiflatMap consistent with value.flatMap+f+pure") { forAll { (eithert: EitherT[List, String, Int], f: Int => List[String]) => eithert.semiflatMap(f) should === (EitherT(eithert.value.flatMap { diff --git a/tests/src/test/scala/cats/tests/IdTSuite.scala b/tests/src/test/scala/cats/tests/IdTSuite.scala index e3f1f65f89..7cc192890c 100644 --- a/tests/src/test/scala/cats/tests/IdTSuite.scala +++ b/tests/src/test/scala/cats/tests/IdTSuite.scala @@ -87,4 +87,11 @@ class IdTSuite extends CatsSuite { } } + test("mapK consistent with f(value)+pure") { + val f: List ~> Option = λ[List ~> Option](_.headOption) + forAll { (idT: IdT[List, Int]) => + idT.mapK(f) should === (IdT(f(idT.value))) + } + } + } diff --git a/tests/src/test/scala/cats/tests/IndexedReaderWriterStateTTests.scala b/tests/src/test/scala/cats/tests/IndexedReaderWriterStateTSuite.scala similarity index 98% rename from tests/src/test/scala/cats/tests/IndexedReaderWriterStateTTests.scala rename to tests/src/test/scala/cats/tests/IndexedReaderWriterStateTSuite.scala index 45748955ea..235e1145fc 100644 --- a/tests/src/test/scala/cats/tests/IndexedReaderWriterStateTTests.scala +++ b/tests/src/test/scala/cats/tests/IndexedReaderWriterStateTSuite.scala @@ -288,6 +288,13 @@ class ReaderWriterStateTSuite extends CatsSuite { } } + test("ReaderWriterStateT.mapK transforms effect") { + val f: Eval ~> Id = λ[Eval ~> Id](_.value) + forAll { (state: ReaderWriterStateT[Eval, Long, String, String, Int], env: Long, initial: String) => + state.mapK(f).runA(env, initial) should === (state.runA(env, initial).value) + } + } + test(".get and then .run produces the same state as value") { forAll { (c: String, initial: Long, rws: ReaderWriterState[String, String, Long, Long]) => val (_, state, value) = rws.get.run(c, initial).value diff --git a/tests/src/test/scala/cats/tests/IndexedStateTSuite.scala b/tests/src/test/scala/cats/tests/IndexedStateTSuite.scala index a708a0b64f..1f5fe0091f 100644 --- a/tests/src/test/scala/cats/tests/IndexedStateTSuite.scala +++ b/tests/src/test/scala/cats/tests/IndexedStateTSuite.scala @@ -233,6 +233,13 @@ class IndexedStateTSuite extends CatsSuite { } } + test("StateT#mapK transforms effect") { + val f: Eval ~> Id = λ[Eval ~> Id](_.value) + forAll { (state: StateT[Eval, Long, Int], initial: Long) => + state.mapK(f).runA(initial) should === (state.runA(initial).value) + } + } + test("StateT#transformS modifies state") { final case class Env(int: Int, str: String) val x = StateT((x: Int) => Option((x + 1, x))) diff --git a/tests/src/test/scala/cats/tests/KleisliSuite.scala b/tests/src/test/scala/cats/tests/KleisliSuite.scala index f6e9029454..4f7257288f 100644 --- a/tests/src/test/scala/cats/tests/KleisliSuite.scala +++ b/tests/src/test/scala/cats/tests/KleisliSuite.scala @@ -164,6 +164,13 @@ class KleisliSuite extends CatsSuite { } } + test("mapK") { + val t: List ~> Option = λ[List ~> Option](_.headOption) + forAll { (f: Kleisli[List, Int, Int], i: Int) => + t(f.run(i)) should === (f.mapK(t).run(i)) + } + } + test("flatMapF") { forAll { (f: Kleisli[List, Int, Int], t: Int => List[Int], i: Int) => f.run(i).flatMap(t) should === (f.flatMapF(t).run(i)) @@ -212,15 +219,6 @@ class KleisliSuite extends CatsSuite { (List(1, 2, 3) >>= l.run) should === (List(Some(2), Some(3), Some(4))) } - test("transform") { - val opt = Kleisli { (x: Int) => Option(x.toDouble) } - val optToList = λ[FunctionK[Option,List]](_.toList) - val list = opt.transform(optToList) - - val is = 0.to(10).toList - is.map(list.run) should === (is.map(Kleisli { (x: Int) => List(x.toDouble) }.run)) - } - test("local") { case class Config(i: Int, s: String) diff --git a/tests/src/test/scala/cats/tests/ListWrapper.scala b/tests/src/test/scala/cats/tests/ListWrapper.scala index d699aac672..821a04865a 100644 --- a/tests/src/test/scala/cats/tests/ListWrapper.scala +++ b/tests/src/test/scala/cats/tests/ListWrapper.scala @@ -37,11 +37,11 @@ import org.scalacheck.Arbitrary.arbitrary final case class ListWrapper[A](list: List[A]) extends AnyVal object ListWrapper { - def order[A:Order]: Order[ListWrapper[A]] = Order[List[A]].on[ListWrapper[A]](_.list) + def order[A:Order]: Order[ListWrapper[A]] = Order.by(_.list) - def partialOrder[A:PartialOrder]: PartialOrder[ListWrapper[A]] = PartialOrder[List[A]].on[ListWrapper[A]](_.list) + def partialOrder[A:PartialOrder]: PartialOrder[ListWrapper[A]] = PartialOrder.by(_.list) - def eqv[A : Eq]: Eq[ListWrapper[A]] = Eq[List[A]].on[ListWrapper[A]](_.list) + def eqv[A : Eq]: Eq[ListWrapper[A]] = Eq.by(_.list) val traverse: Traverse[ListWrapper] = { val F = Traverse[List] diff --git a/tests/src/test/scala/cats/tests/OptionTSuite.scala b/tests/src/test/scala/cats/tests/OptionTSuite.scala index 8bc3751d85..047240a8cc 100644 --- a/tests/src/test/scala/cats/tests/OptionTSuite.scala +++ b/tests/src/test/scala/cats/tests/OptionTSuite.scala @@ -264,6 +264,13 @@ class OptionTSuite extends CatsSuite { } } + test("mapK consistent with f(value)+pure") { + val f: List ~> Option = λ[List ~> Option](_.headOption) + forAll { (optiont: OptionT[List, Int]) => + optiont.mapK(f) should === (OptionT(f(optiont.value))) + } + } + test("semiflatMap consistent with value.flatMap+f+pure") { forAll { (o: OptionT[List, Int], f: Int => List[String]) => o.semiflatMap(f) should === (OptionT(o.value.flatMap { diff --git a/tests/src/test/scala/cats/tests/SortedSetSuite.scala b/tests/src/test/scala/cats/tests/SortedSetSuite.scala index fa2ac4cc80..0c5ca70f26 100644 --- a/tests/src/test/scala/cats/tests/SortedSetSuite.scala +++ b/tests/src/test/scala/cats/tests/SortedSetSuite.scala @@ -14,8 +14,8 @@ class SortedSetSuite extends CatsSuite { checkAll("SortedSet[Int]", FoldableTests[SortedSet].foldable[Int, Int]) checkAll("PartialOrder[SortedSet[Int]]", PartialOrderTests[SortedSet[Int]].partialOrder) - checkAll("PartialOrder[SortedSet[Int]].reverse", PartialOrderTests(PartialOrder[SortedSet[Int]].reverse).partialOrder) - checkAll("PartialOrder[SortedSet[Int]].reverse.reverse", PartialOrderTests(PartialOrder[SortedSet[Int]].reverse.reverse).partialOrder) + checkAll("PartialOrder.reverse(PartialOrder[SortedSet[Int]])", PartialOrderTests(PartialOrder.reverse(PartialOrder[SortedSet[Int]])).partialOrder) + checkAll("PartialOrder.reverse(PartialOrder.reverse(PartialOrder[SortedSet[Int]]))", PartialOrderTests(PartialOrder.reverse(PartialOrder.reverse(PartialOrder[SortedSet[Int]]))).partialOrder) checkAll("BoundedSemilattice[SortedSet[String]]", BoundedSemilatticeTests[SortedSet[String]].boundedSemilattice) checkAll("BoundedSemilattice[SortedSet[String]]", SerializableTests.serializable(BoundedSemilattice[SortedSet[String]])) diff --git a/tests/src/test/scala/cats/tests/SyntaxSuite.scala b/tests/src/test/scala/cats/tests/SyntaxSuite.scala index 2a28009324..736965a2fc 100644 --- a/tests/src/test/scala/cats/tests/SyntaxSuite.scala +++ b/tests/src/test/scala/cats/tests/SyntaxSuite.scala @@ -103,10 +103,12 @@ object SyntaxSuite extends AllInstances with AllSyntax { val b = mock[B] val f1 = mock[(B, A) => B] val b0: B = fa.foldLeft(b)(f1) + val b1: B = fa.foldl(b)(f1) val a0: A = fa.fold val f2 = mock[(A, Eval[B]) => Eval[B]] val lb0: Eval[B] = fa.foldRight(Now(b))(f2) + val lb1: Eval[B] = fa.foldr(Now(b))(f2) val fz = mock[F[Z]] val f3 = mock[Z => A] diff --git a/tests/src/test/scala/cats/tests/ValidatedSuite.scala b/tests/src/test/scala/cats/tests/ValidatedSuite.scala index c52720f4c5..137311a05f 100644 --- a/tests/src/test/scala/cats/tests/ValidatedSuite.scala +++ b/tests/src/test/scala/cats/tests/ValidatedSuite.scala @@ -267,4 +267,16 @@ class ValidatedSuite extends CatsSuite { } } } + + test("cond consistent with Either.cond + toValidated") { + forAll { (cond: Boolean, s: String, i: Int) => + Validated.cond(cond, s, i) should === (Either.cond(cond, s, i).toValidated) + } + } + + test("condNel consistent with Either.cond + toValidatedNel") { + forAll { (cond: Boolean, s: String, i: Int) => + Validated.condNel(cond, s, i) should === (Either.cond(cond, s, i).toValidatedNel) + } + } } diff --git a/tests/src/test/scala/cats/tests/WriterTSuite.scala b/tests/src/test/scala/cats/tests/WriterTSuite.scala index 6cbcbd5dc2..06ca448ed7 100644 --- a/tests/src/test/scala/cats/tests/WriterTSuite.scala +++ b/tests/src/test/scala/cats/tests/WriterTSuite.scala @@ -64,7 +64,7 @@ class WriterTSuite extends CatsSuite { WriterT.valueT[Id, Int, Int](i).value should === (i) } } - + test("Writer.pure and WriterT.lift are consistent") { forAll { (i: Int) => val writer: Writer[String, Int] = Writer.value(i) @@ -72,7 +72,7 @@ class WriterTSuite extends CatsSuite { writer.run.some should === (writerT.run) } } - + test("show") { val writerT: WriterT[Id, List[String], String] = WriterT.put("foo")(List("Some log message")) writerT.show should === ("(List(Some log message),foo)") @@ -89,6 +89,13 @@ class WriterTSuite extends CatsSuite { Writer.tell("foo").written should === ("foo") } + test("mapK consistent with f(value)+pure") { + val f: List ~> Option = λ[List ~> Option](_.headOption) + forAll { (writert: WriterT[List, String, Int]) => + writert.mapK(f) should === (WriterT(f(writert.run))) + } + } + { // F has a SemigroupK implicit val F: SemigroupK[ListWrapper] = ListWrapper.semigroupK