Lightweight, modular, and extensible library for functional programming.
Scala Shell
andyscott and kailuowang Add Cofree.ana and Cofree.anaEval (#2325)
* Add Cofree.ana (Cofree.unfold but with fused map)

* Adjust Cofree.ana test to better demonstate usage (slightly)

* Generalize ana for Eval; reimplement a few methods in terms of anaE

* Rename anaE to anaEval
Latest commit e15188b Jul 18, 2018
Failed to load latest commit information.
alleycats-core Port alleycats from the defunct repo (#2222) Apr 9, 2018
alleycats-laws/src/main/scala/alleycats/laws/discipline Welcome, Alleycats (#1984) Oct 26, 2017
alleycats-tests/src/test/scala/alleycats/tests Add `SortedMap` and `SortedSet` instances/Move `Set` and `Map` instan… Oct 30, 2017
bench/src/main/scala/cats/bench Fix #2186: make IndexedStateT stack safe (#2187) Mar 14, 2018
core/src/main/scala/cats Add Representable Functor (#2284) Jul 9, 2018
docs/src/main Merge pull request #2248 from rsekulski/patch-1 Jun 11, 2018
free/src Add Cofree.ana and Cofree.anaEval (#2325) Jul 18, 2018
js/src Add more Parallel instances (#1938) Nov 18, 2017
jvm/src/test/scala/cats/tests Add more Parallel instances (#1938) Nov 18, 2017
kernel-laws/src Split buildJVM Mar 11, 2018
kernel/src/main/scala/cats/kernel Change override of neqv in Order (#2232) Apr 17, 2018
laws/src Add Representable Functor (#2284) Jul 9, 2018
macros/src/main/scala/cats/macros More coverage (#1752) Jul 17, 2017
project Specify the source of the autogenerated boilerplate (#2307) Jun 26, 2018
scalafix Remove trailing comma as a workaround for #2136 (#2137) Jan 4, 2018
scripts fix script Dec 5, 2017
testkit/src/main/scala/cats/tests Add Representable Functor (#2284) Jul 9, 2018
tests/src/test Add Representable Functor (#2284) Jul 9, 2018
.gitignore Consolidate and (#1915) Sep 20, 2017
.jvmopts Replace to new jvm flag (#2298) Jun 26, 2018
.travis.yml Update Scala, sbt, and sbt plugins (#2260) May 19, 2018 Update Mar 16, 2018 Update Mar 16, 2018 add editor setup tips to contrib guide (#2280) Jun 26, 2018
COPYING add basic license Jan 29, 2015 Include kernel in modules doc Jun 27, 2016 fix typo Nov 10, 2016 Add Rainier to the cats library (#2311) Jul 4, 2018
build.sbt Change scaladoc link title to "API Documentation" (#2303) Jun 20, 2018
scalastyle-config.xml Add scalastyle rule for single space after if Jun 24, 2016
version.sbt merge 1.1.x back to master (#2199) Mar 17, 2018


cats image

Build Status Workflow Chat Latest version Scala.js


Cats is a library which provides abstractions for functional programming in the Scala programming language. The name is a playful shortening of the word category.

Scala supports both object-oriented and functional programming, and this is reflected in the hybrid approach of the standard library. Cats strives to provide functional programming abstractions that are core, binary compatible, modular, approachable and efficient. A broader goal of Cats is to provide a foundation for an ecosystem of pure, typeful libraries to support functional programming in Scala applications.

For more detail about Cats' motivations, go here.

You can read the API Documentation, here.

Getting Started

Cats is currently available for Scala 2.10, 2.11 and 2.12, and Scala.js.

Cats relies on improved type inference via the fix for SI-2712, which is not enabled by default. For Scala 2.11.9 or later you should add the following to your build.sbt:

scalacOptions += "-Ypartial-unification"

Or, if you need to support older versions of Scala you can use the sbt-partial-unification plugin which extends support back through Scala 2.10.6 or later, to add it, simply add this line to your plugins.sbt:

addSbtPlugin("org.lyranthe.sbt" % "partial-unification" % "1.1.0")

And then create the Cats dependency, by adding the following to your build.sbt:

libraryDependencies += "org.typelevel" %% "cats-core" % "1.1.0"

This will pull in the cats-core module. If you require some other functionality, you can pick-and-choose from amongst these modules (used in place of "cats-core"):

  • cats-macros: Macros used by Cats syntax (required).
  • cats-kernel: Small set of basic type classes (required).
  • cats-core: Most core type classes and functionality (required).
  • 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: standard IO type together with Sync, Async and Effect type classes
  • cats-mtl: transformer typeclasses for Cats' Monads, Applicatives and Functors.
  • mouse: a small companion to Cats that provides convenient syntax (aka extension methods)

Release notes for Cats are available in

Cats is still under active development. While we don't anticipate any major redesigns, changes that are neither source nor binary compatible are to be expected in upcoming RC1 and 1.0 releases.

The Cats ecosystem

By sharing the same set of type classes, instances and data types provided by Cats, projects can speak the same "Cats language", and integrate with each other with ease.

General purpose libraries to support pure functional programming

  • Dogs: pure functional collections and data structures
  • Dsl.scala: The !-notation for creating Cats monadic expressions
  • eff: functional effects and effect handlers (alternative to monad transformers)
  • Freestyle: pure functional framework for Free and Tagless Final apps & libs
  • iota: Fast [co]product types with a clean syntax
  • Kittens: automatic type class derivation for Cats and generic utility functions
  • mainecoon: Transform and compose tagless final encoded algebras
  • Monocle: an optics library for Scala (and Scala.js) strongly inspired by Haskell Lens.
  • newts: Defines newtypes compatible with Cats type classes
  • origami: monadic folds
  • refined: simple refinement types for Scala
  • shims: seamless interoperability for cats and scalaz typeclasses and datatypes

Libraries with more specific uses

  • atto: friendly little text parsers
  • circe: pure functional JSON library
  • Ciris: Lightweight, extensible, and validated configuration loading in Scala
  • decline: A composable command-line parser
  • doobie: a pure functional JDBC layer for Scala
  • fastparse-cats: cats Monad and Alternative instances for fastparse
  • Fetch: efficient data access to heterogeneous data sources
  • finch: Scala combinator library for building Finagle HTTP services
  • Frameless: Expressive types for Spark
  • FS2: compositional, streaming I/O library
  • grafter: dependency-injection library using the Reader pattern
  • hammock: Purely functional HTTP client
  • henkan: Type safe conversion between case class instances with similar fields
  • http4s: A minimal, idiomatic Scala interface for HTTP
  • monadic-html: Tiny DOM binding library for Scala.js
  • Monix: high-performance library for composing asynchronous and event-based programs
  • pureconfig: A boilerplate-free library for loading configuration files
  • rainier: Bayesian inference in Scala
  • scanamo: simpler DynamoDB access for Scala
  • seals: tools for schema evolution and language-integrated schemata
  • tsec: Typesafe, functional, general purpose cryptography and security library.
  • extruder: Populate case classes from any data source

Feel free to submit a PR if you want a project you maintain to be added to this list.

The full-size Cats logo is available for use for Cats related projects, contents, souvenirs, etc.

How can I contribute to Cats?

We welcome contributions to Cats and would love for you to help build Cats. See our contributor guide for more information about how you can get involved.


Discussion around Cats is currently happening on Github issue and PR pages as well as in two Gitter channels:

Gitter channel cats is for general user questions and discussions, and

Gitter channel cats-dev is dedicated for Cats development related discussions. For people who wants to follow closely and/or to participate in the decisions in Cats development, this is the room to join.

You can get an overview of who is working on what via

People are expected to follow the Typelevel Code of Conduct when discussing Cats on the Github page, Gitter channel, or other venues.

We hope that our community will be respectful, helpful, and kind. If you find yourself embroiled in a situation that becomes heated, or that fails to live up to our expectations, you should disengage and contact one of the project maintainers in private. We hope to avoid letting minor aggressions and misunderstandings escalate into larger problems.

If you are being harassed, please contact one of us immediately so that we can support you.

Binary compatibility and versioning

After 1.0.0 release, we decided to use MAJOR.MINOR.PATCH Semantic Versioning 2.0.0 going forward, which is different from the EPOCH.MAJOR.MINOR scheme common among Java and Scala libraries (including the Scala lang).

Cats strives to provide a solid and stable foundation for an ecosystem of FP libraries. Thus, we treat backward binary compatibility maintenance with a high priority. In semantic versioning, backward breaking change is ONLY allowed between MAJOR versions. We will maintain backward binary compatibility between PATCH AND MINOR versions. For example, when we release Cats 1.1.0, it will be backward binary compatible with the previous 1.0.x versions. I.E. the new JAR will be a drop-in replacement for the old one. This is critical when your application has a diamond dependency on Cats - depending on two or more libraries that all depend on Cats. If one library upgrades to the new 1.1.0 Cats before the other one does, your application still runs thanks to this backward binary compatibility.

Also worth noting is that according to semantic versioning, MINOR version Y (x.Y.z | x > 0) MUST be incremented if new, backwards compatible functionality is introduced to the public API. It MUST be incremented if any public API functionality is marked as deprecated.

Any binary breaking changes will require a MAJOR version bump, which we will be very cautious about. We will also consider using organization and package name for major versioning in the future. But that decision is yet to be made.


The current maintainers (people who can merge pull requests) are:

We are currently following a practice of requiring at least two sign-offs to merge PRs (and for large or contentious issues we may wait for more). For typos or other small fixes to documentation we relax this to a single sign-off.

Copyright and License

All code is available to you under the MIT license, available at and also in the COPYING file. The design is informed by many other projects, in particular Scalaz.

Copyright the maintainers, 2015-2017.