For when purity just isn't impure enough.
This project aims to provide a standard
- Manages both synchronous and asynchronous (callback-driven) effects
- Compatible with a single-threaded runtime
In this way,
IO is more similar to common
Task implementations than it is to the classic
scalaz.effect.IO or even Haskell's
IO, both of which are purely synchronous in nature. As Haskell's runtime uses green threading, a synchronous
Versions of Cats Effect:
- Release Candidate:
See compatibility and versioning for more information on our compatibility and semantic versioning policies.
libraryDependencies += "org.typelevel" %% "cats-effect" % "2.1.4"
Cats Effect relies on improved type inference and needs partial unification enabled as described in the Cats Getting Started documentation.
If your project uses Scala.js, replace the double-
% with a triple. Note that cats-effect has an upstream dependency on cats-core version 2.x.
Cross-builds are available for Scala 2.12.x and 2.13.x, with Scala.js builds targeting both 0.6.x and 1.0.x (note that 2.2.0-RC1, and all future releases after 2.1.x, will no longer target Scala.js 0.6.x).
The most current snapshot (or major release) can be found in the maven badge at the top of this readme. If you are a very brave sort, you are free to depend on snapshots; they are stable versions, as they are derived from the git hash rather than an unstable
-SNAPSHOT suffix, but they do not come with any particular confidence or compatibility guarantees.
Please see this document for information on how to cryptographically verify the integrity of cats-effect releases. You should absolutely be doing this! It takes five minutes and eliminates the need to trust a third-party with your classpath.
The cats-effect-laws artifact provides Discipline-style laws for the
ConcurrentEffect typeclasses (
LiftIO is lawless, but highly parametric). It is relatively easy to use these laws to test your own implementations of these typeclasses. Take a look here for more.
libraryDependencies += "org.typelevel" %% "cats-effect-laws" % "2.1.4" % "test"
These laws are compatible with both Specs2 and ScalaTest.
Related Cats links (the core):
These are some well known libraries that depend on
|Ciris||Lightweight, extensible, and validated configuration loading in Scala|
|Doobie||A principled JDBC layer for Scala|
|Eff||Extensible Effects for Scala|
|Fs2||Functional Streams for Scala (Streaming I/O library)|
|Finch||Scala combinator API for building Finagle HTTP services|
|Http4s||Typeful, functional, streaming HTTP for Scala|
|Monix||Asynchronous, Reactive Programming for Scala and Scala.js|
|Pure Config||A boilerplate-free library for loading configuration files|
|Scala Cache||A facade for the most popular cache implementations for Scala|
|Sttp||The Scala HTTP client you always wanted|
These are some of the projects that provide high-level functions on top of
|Cats Retry||A library for retrying actions that can fail|
|Console4cats||Console I/O for Cats Effect|
|Linebacker||Thread Pool Management for Scala: Enabling functional blocking where needed|
|Cats STM||Software Transactional Memory for Cats Effect|
|Mau||A tiny library for an auto polling
|Odin||Fast & Functional logger with own logging backend|
|cats-effect-testing||Experimental integration between cats-effect and testing frameworks|
|graphite4s||lightweight graphite client|
We use the standard pull request driven github workflow. Pull requests are always welcome, even if it's for something as minor as a whitespace tweak! If you're a maintainer, you are expected to do your work in pull requests, rather than pushing directly to master. Ideally, someone other than yourself will merge and push your PR to master. However, if you've received at least one explicit
Do not rebase commits that have been PR'd! That history doesn't belong to you anymore, and it is not yours to rewrite. This goes for maintainers and contributors alike. Rebasing locally is completely fine (and encouraged), since linear history is pretty and checkpoint commits are not. Just don't rebase something that's already out there unless you've explicitly marked it as a work in progress (e.g.
[WIP]) in some clear and unambiguous way.
cats-effect is a Typelevel project. This means we embrace pure, typeful, functional programming, and provide a safe and friendly environment for teaching, learning, and contributing as described in the Code of Conduct.
The sources for the cats-effect microsite can be found in
site/src/main/mdoc. The menu structure is in
You can build the microsite with
To preview your changes you need to have jekyll installed. This depends on your platform, but assuming you have ruby installed it could be as simple as
gem install jekyll. Alternatively, you can use the provided Gemfile under
site to install jekyll and the required plugins.
Start a local server by navigating to
site/target/site, then run
jekyll serve -b /cats-effect. Finally point your browser at http://localhost:4000/cats-effect/. Any changes should be picked up immediately when you re-run
Development of Cats Effect is generously supported in part by YourKit through the use of their excellent Java profiler.
Copyright (c) 2017-2019 The Typelevel Cats-effect Project Developers Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.