Skip to content

Releases: typelevel/cats

1.0.0-RC2

19 Dec 09:49
v1.0.0-RC2
38b9f91
Compare
Choose a tag to compare

Version 1.0.0-RC2

2017 Nov 25

Breaking changes and migration

  • #2039 Remove Applicative#traverse and Applicative#sequence by @kubukoz
  • #2033 standardise on liftF and add liftK to transformers by @SystemFw
  • #2083 Change forEffect/followedBy to productL/productR by @Jacoby6000
  • #2088 Add InvariantSemigroupal and ability to turn Monoidals to Monoids by @LukaJCB

New features / enhancements (API, instances, data types, etc.):

Bug fixes:

Documentation Improvements/Additions:

Build improvements/dependency updates

Testing improvements

1.0.0-RC1

31 Oct 15:27
v1.0.0-RC1
46f389e
Compare
Choose a tag to compare

Version 1.0.0-RC1

2017 Oct 21

This is the only planned release candidate release prior to 1.0.0, which if everything goes according to plan, shall come in 2-3 weeks.

Breaking changes and migration

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.
  • 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 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.):

Bug fixes:

Documentation Improvements/Additions:

Read more

Cats 1.0.0-MF

03 Aug 18:39
v1.0.0-MF
e70c89c
Compare
Choose a tag to compare

Version 1.0.0-MF

2017 Aug 3

MF stands for milestone final. This is the last non-RC release before 1.0.0.
The main purpose/focus of this release is to offer a relatively stable API to
work with prior to 1.0.0. It can be deemed as a proposal for the final API
we are going to maintain binary compatibiliy after 1.0.
We will give community some time to validate it before we release 1.0.0-RC1.

To migrate from 0.9.0

We apologize for the number of breaking changes in this release. We are trying to include
as many breaking changes as possible in this release before we lock down the API.

  • 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".
  • cats.free.Inject is moved from cats-free to cats-core and renamed to cats.InjectK;
    cats.data.Prod is renamed to cats.data.Tuple2K; cats.data.Coproduct is renamed to
    cats.data.EitherK
  • All Unapply enabled methods, e.g. sequenceU, traverseU, etc. are removed. Unapply
    enabled syntax ops are also removed. Please use the partial unification SI-2712 fix
    instead. The easiest way might be this sbt-plugin.
  • FunctorFilter, MonadCombine, MonadFilter, MonadReader, MonadState, MonadTrans, MonadWriter and TraverseFilter are no longer in cats, the functionalities they provided are inhereted by the new cats-mtl project. Please check here for migration guide.
  • CartesianBuilder (i.e. |@|) syntax is deprecated, use the apply syntax on tuples instead. E.g. (x |@| y |@| z).map(...) should be replaced by (x, y, z).mapN(...). If you are getting "mapN not found" error message, it could be due to SI-2712, see the 3rd migration item above.
  • 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.
  • The creation methods (left, right, apply, pure, etc.) in EitherT were improved to take less
    type arguments.
  • Several cats-core type class instances for cats.kernel were moved from their companion objects to separate traits
    and thus require imports from cats.instances.xxx._ (or the recommended import cats.implicits._) now. See #1659 for more details.
  • Free.suspend is renamed to Free.defer for consistency.
  • traverse1_, intercalate1 and sequence1_ in Reducible were renamed to nonEmptyTraverse_, nonEmptyIntercalate and nonEmptySequence_ respectively.
  • foldLeftM is removed from Free, use foldM on Foldable instead, see #1117 for detail.
  • iteratorFoldM was removed from Foldable due to #1716
  • 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

If you feel adventurous you can try the experimental Scalafix rewrites.
See all the available rewrites and the instructions here.

Breaking Changes:

New Features (API, instances, data types, etc):

Code improvements:

  • #1660: Override fromTry and fromEither for Try and `...
Read more

Cats 0.9.0

16 Jan 03:44
Compare
Choose a tag to compare

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 and NonEmptyVector are now covariant
  • #1506: flatMap provided by Either syntax matches 2.12's Either#flatMap
  • #1466: Improved stack safety for StateT
  • #1510: catchNonFatal for Future is now asynchronous

Bug fixes:

  • #1465 and #1507: Stack safety law for Monad#tailRecM is less eager and doesn't throw exceptions

New type class instances:

  • #1475: Reducible instances for Eval and Id
  • #1484: Show instance for Symbol

Other additions:

  • #1446: Cofree comonad
  • #1520 and #1522: intercalate for Foldable (and intercalate1 for Reducible)
  • #1454: asLeft and asRight syntax methods for creating Either values
  • #1468: tupleLeft and tupleRight for Functor
  • #1500: putLeft, putRight, mergeLeft, and mergeRight methods for Ior
  • #1495: show string interpolator
  • #1448: Validated#findValid (like orElse but error accumulating)
  • #1455: reverse for NonEmptyList
  • #1517: zipWithIndex for NonEmptyList
  • #1512 and #1514: filterNot for NonEmptyList and NonEmptyVector
  • #1480: FunctionK#and
  • #1481: EitherT.cond

Miscellaneous improvements (syntax, documentation, tests):

  • #1513: Improved documentation for Functor, Applicative, and Traverse
  • #1440: Improved type class documentation
  • #1442: Improved documentation for Semigroup and Monoid
  • #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 and MonoidK instances
  • #1490: Avoid some duplication in build via sbt-travisci
  • #1497: Site list clean-up

And version updates:

  • #1499: 2.12 version is now 2.12.1
  • #1509: Scala.js version is 0.6.14

As always thanks to everyone who filed issues, participated in the Cats Gitter channel, submitted code, or helped review pull requests.

Cats 0.8.1

09 Nov 22:49
Compare
Choose a tag to compare

Version 0.8.1 is a release to support Scala 2.12.0 with no changes to published code (only tests and documentation).

Build:

  • #1457: Update to Scala 2.12.0

Miscellaneous improvements (syntax, documentation, tests):

  • #1444: Remove defaultTailRecM from monad doc
  • #1441: Fixes #1438 by replacing quoted entry name
  • #1432: Type class organization in documentation
  • #1439: Update version on index
  • #1451: Fix Arbitrary instances for ScalaCheck 1.13.3+

Cats 0.8.0

26 Oct 21:05
@non non
Compare
Choose a tag to compare

Version 0.8.0 is the eighth Cats release, and the first release with support for Scala 2.12 (specifically the 2.12.0-RC2 release candidate).

Apart from the introduction of Scala 2.12 support, the biggest change in this release is the removal of Xor and XorT. See the FAQ for information about the motivations for this change and recommendations for migration.

Removals and deprecations:

  • #1310: Xor and XorT are gone
  • #1370: RecursiveTailRecM and Free#foldMapUnsafe are gone and stack safety is checked in the laws for Monad
  • #1411: FreeT#interpret is deprecated in favor of the (equivalent) compile

Additions:

  • #1382, #1415: Support for Scala 2.12.0-RC2
  • #1414: Foldable#iteratorFoldM and lazy foldM implementations for many standard library instances
  • #1356: append and prepend (and operator aliases) for NonEmptyVector
  • #1327: EitherT.fromOption
  • #1388: StateT.set and StateT.setF
  • #1392: StateT.get
  • #1325: WriterT.lift
  • #1391: MonadReader#reader
  • #1352: Macro-powered FunctionK.lift
  • #1398: <<< and >>> aliases for Compose's compose and andThen
  • #1408: toNestedValidated and toNestedValidatedNel for EitherT
  • #1399: Order.fromComparable
  • #1394: Traverse#flatSequence
  • #1417: MonadTests#stackUnsafeMonad laws for instances where tailRecM is known to be unsafe
  • #1411: compile and foldMap for the Free and FreeT companion objects

New instances:

  • #1319: Order and Group for BigDecimal
  • #1354: Semigroup for Ior
  • #1395: Order for Symbol
  • #1324: PartialOrder and other instances for BitSet
  • #1324: Eq and PartialOrder for Either
  • #1324: PartialOrder, Monoid, and other instances for Function0
  • #1324: Monoid and other instances for Function1
  • #1402: Monad, MonadCombine, Traverse, Order, etc. for Prod
  • #1413: MonadError for StateT
  • #1399: Instances for java.util.UUID

Renaming and rearrangements:

  • #1385: The cats.js.std package is now cats.js.instances
  • #1324: Many instances moved from cats-core to cats-kernel
  • #1394: Traverse#traverseM is now flatTraverse

Miscellaneous improvements (syntax, documentation, tests):

  • #1347: Consistency laws for combineAll and combineAllOption
  • #1324: Performance improvements for Either instances
  • #1386: FunctionK tests and examples now use kind-projector 0.9's polymorphic lambdas
  • #1410: Replace Coproduct#run with Coproduct#fold
  • #1331: Less expensive tailRecM-flatMap consistency checking
  • #1330: More consistent parameter-less method definitions and usage, other syntactic improvements
  • #1340: New Scaladex badge
  • #1416: New diagram of type classes
  • #1352: API docs for FunctionK
  • #1369, #1418: New project site based on sbt-microsites
  • #1259: 0.6-to-0.7 migration guide
  • #1304, #1317, #1323, #1350, #1366, #1376, #1380, #1390, #1403, #1407, #1421: Other miscellaneous documentation improvements

Build:

  • #1345: Update ScalaCheck (to 1.13.2) and Discipline (to 0.6)
  • #1353: Generated sources are included in source jars
  • #1322: Scala.js test clean-up
  • #1426: Human-friendly names in metadata for published artifacts
  • #1389: More memory for Travis CI

Cats 0.7.2

02 Sep 15:07
Compare
Choose a tag to compare

Version 0.7.2 is a patch release that was released to fix a major bug (#1346) that appeared in 0.7.0. It also contains several other improvements.

It should be safe to upgrade from 0.7.0 to 0.7.2 — there are no major API changes between these releases.

Changes

Fixes:

  • #1347: fixes broken Monoid[Map[K, V]].combineAll implementation.
  • #1304: fix CoflatMap documentation.
  • #1322: fix SBT commands (release, validate, etc.).
  • #1311: rename some implicit instances for consistency.

Additions:

  • #1319: add missing BigDecimal instances.
  • #1324: add missing function and BitSet instances.

Note that 0.7.2 was preceeded by a botched 0.7.1. release. Please avoid using this version of Cats — it has major incompatibilities with 0.7.0 and is not documented here.

Cats 0.7.0

21 Aug 14:17
@non non
Compare
Choose a tag to compare

Version 0.7.0 is the seventh Cats release, and includes several major rearrangements and changes to names.

Migration notes

If you're updating from Cats 0.6.0, it's likely that you'll need to make extensive (but mostly mechanical) changes. The following list includes some of the changes that are likely to be necessary for most projects; see the complete list of changes below for more detail.

  • All references to cats.std will need to be changed to cats.instances (#1140). If you're using cats.std.all or the other cats.std objects with wildcard imports, this is likely to be the only change you need to make. If you are importing or referring to instance definitions by name, you'll need to be aware that the naming convention has changed (see #1066, #1068, #1110, and #1122).
  • NonEmptyList and NonEmptyVector are no longer type aliases for OneAnd, so any code using OneAnd to construct or pattern match on these types will need to be changed to use NonEmptyList or NonEmptyVector directly. There are also some API changes; for example, unwrap calls will need to be replaced by toList or toVector, and NonEmptyList(1, 2, 3) is now NonEmptyList.of(1, 2, 3).
  • pureEval has been removed from Applicative (#1234), and has not been replaced, so if you are relying on it for laziness or effect capturing (which wasn't enforced or guaranteed), you'll need to find another approach.
  • All references to NaturalTransformation will need to be replaced by either FunctionK or ~>.
  • The FlatMap type class now has a tailRecM method that is designed to support stack-safe recursive monadic binding. If your monad's flatMap is stack safe, you can implement a stack-safe tailRecM by calling Monad#defaultTailRecM. The stack safety of tailRecM is not enforced, but if your implementation is stack safe, you should also provide an instance of the RecursiveTailRecM marker type class.
  • If you are interpreting a free algebra into a context F with foldMap, you'll now need F to have an instance of the RecursiveTailRecM marker type class (in addition to the Monad instance).

If you run into any issues while updating, please get in touch on Gitter.

Changes

This release includes a fix for a bug in 0.6.0 (also fixed in 0.6.1):

  • #1062: Order instances for tuples are now lexicographic (instead of only comparing first elements)

And other bug fixes:

  • #1096: inj and prj on Inject now work consistently with respect to null

And some additions:

  • #1289 and #1306: EitherT and improved Either syntax
  • #1280: FlatMap now has a tailRecM method
  • #1280: RecursiveTailRecM marker type class indicating that tailRecM is stack safe
  • #1266: FreeT monad transformer
  • #1225: FunctorFilter and TraverseFilter
  • #1121: valueOr and merge for Validated
  • #1188: toValidatedNel for XorT
  • #1127: toTry for Xor
  • #1269: catchNonFatal for ApplicativeError
  • #1130: isEmpty syntax method for Monoid
  • #1167: minimum, maximum, and related helper methods for Foldable and Reducible
  • #1243: distinct on NonEmptyList and NonEmptyVector
  • #1134: cats.syntax.list for à la carte list syntax imports
  • #1191: cats.syntax.monoid for à la carte Monoid syntax imports
  • #588 and #1063: IdT, the identity monad transformer
  • #1021 and #1221: Nested (represents nested composition of type constructors)
  • #1172: toNested for OptionT and XorT
  • #1102 and #1170: Comparison (represents the result of an Order comparison)
  • #1090: Kleisli.lift
  • #1169: lift, inspect, and related methods for StateT
  • #1114: size for Foldable
  • #1193: reduceLeftM for Reducible
  • #1097: Functor variance helpers (widen for Functor and narrow for Contravariant)
  • #1207: tell for Writer and WriterT, value for Writer
  • #1155: Convenience methods for constructing XorT values
  • #1085: runTailRec and foldLeftM for Free
  • #1299: ContravariantCartesian type class

And some name changes:

  • #1140: cats.std is now cats.instances
  • #1066, #1068, #1110, and #1122: More unique type class instance names
  • #1072: NaturalTransformation is now FunctionK
  • #1085: mapSuspension on Free is now compile
  • #1111: Free.Gosub is now Free.FlatMapped
  • #1133: Composite* traits for binary type classes are renamed to Composed* for consistency (and are now private)

And other API changes:

  • #1231: NonEmptyList is now a case class instead of a type alias for a OneAnd
  • #1137: NonEmptyVector is now a value class instead of a type alias for a OneAnd
  • #1267: Overloaded variadic apply on NonEmptyList and NonEmptyVector is now of
  • #1234: Applicative#pureEval has been removed
  • #1202: MonadFilter no longer has a filterM method (see #1225)
  • #1075: foldMap on Free now requires a MonadRec instance (instead of simply Monad)
  • #1085: Free.suspend no longer requires an Applicative instance
  • #1084: Safer toString for Free and FreeApplicative
  • #1100: Simplified constraints for methods on Xor and related types
  • #1171: Prioritization traits are now private

And many new instances:

  • #1059 and #1147: Monoid, MonadError, and other instances for scala.util.Try
  • #1299: Monad for Tuple2
  • #1211: Contravariant for Eq
  • #1220: Traverse and Comonad for Tuple2
  • #1103: Order, MonadError, and other instances for OptionT
  • #1106: Semigroup and Monoid for XorT
  • #1138: SemigroupK and MonadCombine for StateT
  • #1128 Semigroup and Monoid for Applicative
  • #1049: CoflatMap for WriterT
  • #1076 and #1261: MonadRec instances for Eval, StateT, and Future
  • #1105: Unapply instances for Nested shapes

And miscellaneous improvements to style and performance:

  • #1079: More consistent type lambdas
  • #1300: Much faster Monoid instances for Map

And improvements to the documentation:

Read more

Cats 0.6.1

14 Jul 18:30
Compare
Choose a tag to compare

Version 0.6.1 is a patch release compatible with 0.6.0.

It contains one bug fix:

  • #1062: Fixed a bug in the Order and PartialOrder instances for Tuple2+ where only the first element was used in comparisons

It also contains a change to the build:

  • #1173: Add binary compatibility check to all published modules

Cats 0.6.0

20 May 11:08
Compare
Choose a tag to compare

Version 0.6.0 is the sixth release.

Highlights of this release:

  • #990: Separate free package into its own module
  • #1001: Introduce cats-kernel and remove algebra dependency

This release also includes some API changes:

  • #1046: summon ApplicativeErrorSyntax for F[_] instead of F[_, _]
  • #1034: Don't combine lefts on Xor and XorT combine
  • #1018: Remove blocking (JVM-only) Future instances
  • #877: Remove required laziness in Prod, fixes #615

And additions:

  • #1032: Added Coproduct fold
  • #1028: Added withFilter for OptionT
  • #1014: Added Monoid instance for WriterT
  • #1029: Added an ApplicativeError instance for Kleisli and a MonadError[Option, Unit] to std.option
  • #1023: Add XorT#fromEither
  • #984: Add Validated.ensure
  • #1020: Add Traverse.traverseM

And some code improvements:

  • #1015: Add Apply.map2Eval and allow traverse laziness
  • #1024: Override reverse on reversed PartialOrder to return original instance
  • #880: Optimize Eq[Vector[A]] instance
  • #1019: Use Future#successful in pureEval when possible

And bug fixes:

  • #1011: Add missing type parameters.

And some other improvements to the organization documentation, tutorials, laws and tests, including:

  • #1045: Add a link to the OptionT documentation from the monad docs.
  • #1043: Add notes about kind-projector usage in docs
  • #1042: Cats 0.5.0 no longer pre-release
  • #1036: Add FPiS to the "Resources for Learners" section
  • #1035: Run kernel-law tests for JS as part of build
  • #991: Replace ~> with NaturalTransformation
  • #1027: Remove unnecessary nelSemigroup from traverse doc
  • #1022: Add law-checking for asMeetPartialOrder and asJoinPartialOrder
  • #990: Separate free package into its own module