Skip to content

Releases: typelevel/cats-effect

v1.0.0-RC2

03 Jun 08:35
v1.0.0-RC2
06cf793
Compare
Choose a tag to compare

This is the second and final release candidate before 1.0 — it's not a planned release candidate, but due to a flurry of activity and awesome PRs from FS2, Monix and Http4s contributors, we can't release a 1.0 with so much being added, a total of 35 PRs, which aren't light at all, a record for this project.

List of Changes

New data types:

  1. Resource (doc) — #188
  2. Ref (doc) and Deferred (doc) — #204, #211, #218 and #220
  3. Semaphore (doc) — #205
  4. MVar (doc) — #217, #222, #223, #224
  5. IOApp(doc) — #213, #252

Major behavioral / breaking changes:

  • #232: Require Timer and shift automatically in concurrent operations
  • #237, #254: Restate Concurrent laws to accept auto-cancelable run-loops
  • #241: Move uncancelable to Bracket, change Bracket laws to make acquire and release uncancelable
  • #195, #215 and #261: Add Effect#runSyncStep, fixing #104
  • #248, #258: Introduce Async.asyncF
  • #221: add toIO operation to Effect

Added Features:

  • #191: Add IO#redeemWith, in combination with the future typelevel/cats/pull/2237
  • #214: Add IO#timeout and Concurrent.timeout
  • #236: Bracket instance for Kleisli
  • #234: bracket should work on top of JavaScript via unsafeRunSync
  • #235: remove NonFatal, switch to the standard one
  • #250: Optimize async trampoline, add ContextSwitch
  • #255, #257: use the standard Throwable#addSuppressed in bracket when both use and release throw
  • #253: Add a la carte syntax package, syntax for Bracket and timeouts

Docs:

  • #201: Docs for parTraverse and parSequence
  • #203: Docs for Resource, Deferred, Ref and Semaphore
  • #238: Docs for Resource

Bug fixes and chores:

  • #225: IOTimer does not use the parameter specified
  • #260: Exclude non-terminating laws from default set
  • #259: Decrease default stackSafeIterationsCount in laws

Getting Involved

You can always help with:

  1. Feedback by joining us on Gitter
  2. Re-tweet the release announcement
  3. Give us a star on GitHub 🙂

Special Thanks

This release was made possible by: @rossabaker, @mpilquist, @SystemFw, @oleg-py, @johnynek, @durban, @ptravers, @stephennancekivell, @gvolpe, @ajaychandran and @alexandru .
(apologies if I forgot anybody)

Thanks to all those involved!

v1.0.0-RC

18 Apr 09:32
v1.0.0-RC
a4468ba
Compare
Choose a tag to compare

This is the first and hopefully only release candidate for 1.0.0.

This upgrade breaks binary compatibility with the previous 0.10, so use with care — libraries that depend on Cats Effect must be upgraded first. This version also drops Scala 2.10 support.

The highlight of this release is the Bracket type class, along with its IO implementation, IO#bracket and IO#bracketCase.

Details of usage with IO have been added in the documentation, see the new section:
Safe Resource Acquisition and Release

Features:

  • #113, #186: Adds Bracket type class, along with IO changes, for exposing bracket and bracketCase, operations meant for safe release of resources
  • #182: IO.runAsync should report errors in its handler (back-ported in 0.10.1)
  • #168: adds Async#never
  • #183: adds new config parameter meant for AsyncTests to disable laws that are testing for non-termination

Breaking changes:

  • #177: Removed Sync instance for EitherT[Eval, Throwable, ?]
  • #180: Dropped Scala 2.10 support

Chores:

Cancelable IO (v0.10)

16 Mar 11:48
v0.10
86a3240
Compare
Choose a tag to compare

v0.10 represents a big milestone for the upcoming 1.0.0 (see milestones), bringing you the new and improved IO data type, along with new type classes in support of cancelation.

But first, we now have a documentation website:
typelevel.org/cats-effect/

Checkout the document for IO:
typelevel.org/cats-effect/datatypes/io.html

And also the published ScalaDocs:
typelevel.org/cats-effect/api/

Note: this release is binary compatible with 0.9, but not source compatible, as it has some small API cleanups, deprecated via private[package] — see below for details 😉


Features for cancelation:

  • #121: the cancelable IO
  • #132 and #133: added the Timer data type, to be able to do delayed execution and time measurements in a pure way, while also curing IO's heavy dependency on ExecutionContext
  • #134: adds the new Concurrent and ConcurrentEffect type classes, to complement the existing type classes with cancelation capabilities
  • #137, #142 and #145: adds race and racePair in IO and in the Concurrent type class, for describing race conditions
  • #135, #143, #147, #149, #151, #153, #155, #156, #157: starts a documentation Microsite for Cats-effect, w00t!

Improvements for the provided instances:

  • #144: re-adds cats.data.Kleisli instances, useful for example for Frameless, coupled with #2185 in cats-core in order to preserve coherence
  • #146: optimizes our internal AndThen implementation, currently used for making IndexedStateT stack safe for left-associated binds — this will soon be gone from cats-effect though, due to PR #2187 being merged in cats-core

Other:

  • #130: changed copyright headers in source files to mention a year range, plus it makes it clear that copyright is held by contributors

API breakage

This version is binary compatible with version 0.9, so you can upgrade cats-effect without worries for your other dependencies. However it contains some minor API cleanups that might make your compiler to emit errors.

Async#shift is now deprecated:

trait Async[F[_]] extends Sync[F] with LiftIO[F] {
  // ...

  @deprecated("Moved to Async$.shift, will be removed in 1.0", "0.10")
  private[effect] def shift(ec: ExecutionContext): F[Unit] =
    Async.shift(ec)(this)

Async#shift was moved to the Async companion object. So code like this:

def execute[F[_]](thunk: => A)(implicit F: Async[F], ec: ExecutionContext): F[A] =
  F.shift *> F.delay(thunk)

Needs to be changed to ...

def execute[F[_]](thunk: => A)(implicit F: Async[F], ec: ExecutionContext): F[A] =
  Async.shift[F](ec) *> F.delay(thunk)

The reason for the hard deprecation is that there's no potential for optimization and so it doesn't belong on the Async type class, the derived implementation being the best you can do, in terms of the provided ExecutionContext. It also forces apps to prepare for the upcoming 1.0.0 sooner.

IO.fromFuture no longer requires an ExecutionContext

In case you used IO.fromFuture, it was using an ExecutionContext, but now with 0.10 it will stop doing that ...

import scala.concurrent.ExecutionContext.Implicits.global

IO.fromFuture(IO(Future(1 + 1)))

What happens with the upgrade to 0.10 is that the provided context in this sample will stop being used. So the compiler or the IDE might end up emitting an "unused import" warning.

But if you provided the ExecutionContext explicitly, then this is going to be a compilation error:

// This triggers an error in 0.10
IO.fromFuture(IO(Future(1 + 1)))(global)

Note that the old symbols in both cases are still there, but made private[package] — so binary compatibility is preserved.

v0.10.1

18 Apr 00:11
v0.10.1
4ed75fa
Compare
Choose a tag to compare

Backports the following features:

#161 - update to cats-1.1.0
#167 - fix Effect
#182 - report errors in IO.runAsync handler
#185 - fix IO.runAsync scaladoc

This release is source and binary compatible with cats-effect-0.10.

v0.9

25 Feb 08:07
v0.9
c0614a2
Compare
Choose a tag to compare

This is the last release before PR #121 gets merged.

The highlight of the release is the provided cats.Parallel type-class instance for IO. This makes it now possible to process IO values in parallel, out of the box:

Simple sample:

import cats.implicits._

val name: IO[String] = getName(id)
val age: IO[Int] = getAge(id)

// Assuming `name` and `age` are asynchronous IOs, they'll
// get processed in parallel ...
(name, age).parMapN { (name, age) => Person(name, age) }

Changes:

v0.8

03 Jan 18:43
v0.8
9e251b0
Compare
Choose a tag to compare

Updated Cats to latest version: 1.0.1

v0.5

01 Nov 10:46
v0.5
Compare
Choose a tag to compare

Ongoing minor tweaks leading up to 1.0.

  • Generalized SyncLaws slightly to allow them to be applied to streaming types
  • Added IO.fromEither
  • Upgraded to cats 1.0.0-RC1
  • Arbitrary[IO[A]] (for all Arbitrary[A]) is now included in the cats-effect-laws artifact

v0.4

29 Jul 18:21
v0.4
Compare
Choose a tag to compare

We expect this to be the last major release before cats-effect 1.0, which will target cats-core 1.0 when it is released. There really aren't any major changes left to be made, and stability is a major goal going forward.

Changes in this release:

  • Effect#liftIO has been removed, since it was redundant
  • The stack safety and error propagation laws that were formerly in EffectLaws have been moved up to SyncLaws. This strengthens the requirements on effects which implement Sync but not `Effect
  • Removed Kleisli inductive instances (because of typelevel/cats#1733)
  • Added a law governing the error propagation behavior of Effect#runAsync
  • Bumped cats-core dependency to 1.0.0-MF

v0.3

29 May 18:17
v0.3
Compare
Choose a tag to compare
  • Improved and simplified version of shift (#58)
  • Added an instance Sync[EitherT[Eval, Throwable, ?]]. This is designed to replace the now-removed MonadError functionality in cats.Eval with a sound equivalent.

We are expecting that this will be one of the last compatibility-breaking releases prior to 1.0. The only further changes we would anticipate would be to the laws, but we certainly cannot rule out more.