Back to directory
typelevel avatar

spotted-leopards

Proof of concept for a cats-like library built using Dotty features. Read more below about its uses, features, and usage.

Clone repository

git clone https://github.com/typelevel/spotted-leopards.git

117

Stars

11

Forks

11

Watchers

Apache-2.0

License

Spotted Leopards

Spotted Leopards = Dotty + Cats

Spotted Leopards is a proof of concept for a cats-like library built using Dotty features, with no concern for source compatibility with the existing Cats library. This project has a few goals:

  • explore how new language features in Dotty could be used to improve the encodings of functional type classes and related data types, perhaps informing future Cats / Dotty roadmap
  • provide feedback on Dotty features from the perspective of cats library authors
  • provide a code base of significant size that can be used for learning and exploring Dotty

In short, this project is an experiment only and will not in any way become a library that should be used for real work. This project is NOT a preview of a future Cats version. Rather, it provides a way to explore the design space of the Dotty language features without the constraints of source compatibility and cross-building expected of Cats proper.

Getting Started

To get started, launch sbt console and run the following:

scala> import leopards.{*, given} // Import various types like Monad and OptionT and type class instances

scala> Some(1).map2(Some(2), _ + _)
val res0: Option[Int] = Some(3)

scala> OptionT.fromOption[List, Int](res0)
val res1: leopards.OptionT[List, Int] = List(Some(3))

Releases

Oct 12, 2023

Download .zip

What's Changed

Upgraded to Dotty 0.19.0-RC1 by @privateblue in #5 Add .travis.yml for testing by @jan0sch in #7 Add postfix ops syntax example by @lorandszakacs in #10 Add FunctionK alias + related O...