Skip to content

justjoheinz/cats

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

61 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cats

Overview

Cats is a proof-of-concept library intended to provide abstractions for functional programming in Scala.

The name is a playful shortening of the word category.

cats image

Getting Started

Cats is not currently published, so you'll need to check out this repository to try it out. (In fact, you will need to do a publish-local on algebra in order to have that dependency available.)

To build Cats you should have sbt installed. Run sbt, and then use any of the following commands:

  • compile: compile the code.
  • console: launch a REPL
  • test: run the tests

Gitter

Design

The goal is to provide a lightweight, modular, and extensible library that is approachable and powerful. The library will use modern best practices:

  • simulacrum for minimizing typeclass boilerplate
  • machinist for optimizing implicit operators
  • scalacheck for property-based testing
  • discipline for encoding and testing laws
  • kind-projector for type lambda syntax
  • algebra for shared algebraic structures
  • ...and of course a pure functional subset of the Scala language.

Another design goal is to support Miniboxing in a fork.

Currently Cats is experimenting with providing laziness via a type constructor, rather than via ad-hoc by-name parameters. This design may change if it ends up being impractical.

The goal is to make Cats as efficient as possible for both strict and lazy evaluation. There are also issues around by-name parameters that mean they are not well-suited to all situations where laziness is desirable.

Modules

Cats will be split into modules, both to keep the size of the artifacts down and also to avoid unnecessarily tight coupling between type classes and data types.

Initially Cats will support the following modules:

  • core: Almost exclusively definitions for widely-used type classes.
  • std: Standard type class instances and other useful data types.
  • data: Data types and corresponding type class instances.
  • laws: The encoded laws for type classes, exported to assist third-party testing.
  • tests: Verifies the laws, and runs any other tests. Not published.

As the type class families grow, it's possible that additional modules will be added as well. Modules which depend on other libraries (e.g. Shapeless-based type class derivation) may be added as well.

Contributing

Discussion around Cats is currently happening in the Gitter channel.

Feel free to open an issue if you notice a bug, have an idea for a feature, or have a question about the code. Pull requests are also gladly accepted.

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

Concerns or issues can be sent to Erik Osheim (erik@osheim.org).

Related Projects

Cats is closely-related to Structures; both projects are descended from Scalaz.

There are many related Haskell libraries, for example:

Copyright and License

All code is available to you under the MIT license, available at http://opensource.org/licenses/mit-license.php and also in the COPYING file. The design is informed by many other projects, in particular Scalaz.

Copyright Erik Osheim, 2015.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Scala 100.0%