Cats 0.9.0
The biggest user-facing change in this release is to the behavior of the flatMap
(and related methods) provided by EitherOps
for the standard library's Either
for Scala 2.10 and 2.11. These methods now match the behavior of the flatMap
on Either
in Scala 2.12 in that they don't require the left-hand side types to match.
For example, the following would previously compile on 2.12, but not 2.10 or 2.11:
import cats.syntax.either._
sealed abstract class AppError
case object Error1 extends AppError
case object Error2 extends AppError
val either1: Either[Error1.type, String] = Right("hi")
val either2: Either[Error2.type, String] = Right("bye")
val result: Either[AppError, String] = for {
v1 <- either1
v2 <- either2
} yield v1 + v2
This code now works equivalently on all supported Scala versions.
Changes:
- #1424:
NonEmptyList
andNonEmptyVector
are now covariant - #1506:
flatMap
provided byEither
syntax matches 2.12'sEither#flatMap
- #1466: Improved stack safety for
StateT
- #1510:
catchNonFatal
forFuture
is now asynchronous
Bug fixes:
New type class instances:
Other additions:
- #1446:
Cofree
comonad - #1520 and #1522:
intercalate
forFoldable
(andintercalate1
forReducible
) - #1454:
asLeft
andasRight
syntax methods for creatingEither
values - #1468:
tupleLeft
andtupleRight
forFunctor
- #1500:
putLeft
,putRight
,mergeLeft
, andmergeRight
methods forIor
- #1495:
show
string interpolator - #1448:
Validated#findValid
(likeorElse
but error accumulating) - #1455:
reverse
forNonEmptyList
- #1517:
zipWithIndex
forNonEmptyList
- #1512 and #1514:
filterNot
forNonEmptyList
andNonEmptyVector
- #1480:
FunctionK#and
- #1481:
EitherT.cond
Miscellaneous improvements (syntax, documentation, tests):
- #1513: Improved documentation for
Functor
,Applicative
, andTraverse
- #1440: Improved type class documentation
- #1442: Improved documentation for
Semigroup
andMonoid
- #1479: Some instance traits are now package-private
- #1445: Workaround for Tut issue
- #1477: Use new kind-projector syntax for polymorphic lambdas
- #1483: Binary compatibility checking is now part of the build for cats-kernel
- #1469: More consistent instance names
- #1496: Simpler creation of some
SemigroupK
andMonoidK
instances - #1490: Avoid some duplication in build via sbt-travisci
- #1497: Site list clean-up
And version updates:
As always thanks to everyone who filed issues, participated in the Cats Gitter channel, submitted code, or helped review pull requests.