Scalaz (Scar-lah-zed) is a library written in the Scala Programming Language. One mandate of the library is to depend only on the core Scala API and the core Java 2 Standard Edition API. The intention of Scalaz is to include general functions that are not currently available in the core Scala API. Scalaz is released under a BSD open source licence making it compatible with the licence of the Scala project.
Scalaz has recently (December 2009) undergone a rewrite for a planned version 5 release coinciding with the upcoming Scala 2.8.0 release. Much of what was included in previous versions is still available however, it is better organised.
Links
Detailed features of Scalaz 5
- An implementation of common type-classes
- Equal - for doing type-safe (and configurable) equality checks
- Show - for type-safe configuration of display for types (like Java's toString but with a compile-time check for existence and easier to use)
- Order - type-safe comparisons for ordering
- An integration of useful libraries for the ScalaCheck library
- A usable implementation of John Hughes' arrows for doing abstraction gymnastics with first-class functions
- An implementation of Applicative Functors as per Applicative Programming with Effects for a more powerful (more general) monad
- An implementation of a covariant binary functor (scalaz.Bifunctor) for mapping over either (or both) side of a pair or scala.Either
- A Burkhard-Keller tree for fast approximation-based searches -- ever wondered why Google knows what you really meant, so quickly? Here is a great explanation of a B-K Tree
- An implementation of a contra-variant functor and comonad
- A first-class continuation type
- A Digit data type (0-9)
- A monad and functor "type-class" with associated implementation and methods
- Kleisli and Co-Kleisli data types and subsequent useful operations
- A data type for representing one or more elements of the same type (NonEmptyList) and so guarantees successful termination of head, tail and other operations
- A data type for representing elements of the same type (DList) with constant time append/prepend operations.
- A monoid type-class and (so many!) implementations
- A data type for representing state transition through a value i.e. a function: S => (S, A)
- An implementation of an internal iterator as per The Essence of the Iterator Pattern using a traversable type-class (scalaz.Traverse)
- A multi-way tree (rose tree) and a one-hole zipper (TreeLoc) for tree traversal.
- A pointed list (zipper list) data type
- A memoisation library for automatically storing the result of computations (especially useful for Dynamic Programming Algorithms)
- A light-weight and highly configurable concurrency library with actors and non-blocking composable future values (Promise). Presentation
- Wrappers for existing library types to provide additional useful methods
- Array[Byte]
- BigInteger
- Boolean
- Byte
- Char
- Int
- forall A. Iterable[A]
- forall A. List[A]
- Long
- forall A. Option[A]
- Short
- forall A. Stream[A]
- String
Obtaining Scalaz through SBT or Maven
We are periodically publishing snapshots to the Scala Tools repository.
| Group | Artifact | Version | Description |
| com.googlecode.scalaz | scalaz-core_2.8.0.Beta1-RC8 | 5.0-SNAPSHOT | Core API, no dependencies. |
| com.googlecode.scalaz | scalaz-http_2.8.0.Beta1-RC8 | 5.0-SNAPSHOT | HTTP, aka Slinky. Depends on Servlet API 2.5 |
| com.googlecode.scalaz | scalaz-scalacheck-binding_2.8.0.Beta1-RC8 | 5.0-SNAPSHOT | Bindings for ScalaCheck, including Arbitrary instances for Scalaz data structures. Depends on ScalaCheck |
| com.googlecode.scalaz | scalaz-example_2.8.0.Beta1-RC8 | 5.0-SNAPSHOT | Usage examples |