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 (April 2009) undergone a rewrite for a planned version 4 release. Much of what was included in previous versions is still available however, it is better organised. It is intended for a user to get going with Scalaz 4 with a single import (import scalaz.S._). Unfortunately, this requires a bit of work from us, the library writers, as per Scala, but we have determined that it is worth it.
Scalaz 4 is intended to include a host of new libraries roughly sorted into packages as follows:
- scalaz
Basic data structures, type-classes that are not specific to any domain
- scalaz.http
Data structures for writing web applications (based on the slinky prototype)
- scalaz.database
Data structures for JDBC
- scalaz.parser
Data structures for parsing
- scalaz.geo
Libraries for geographic calculations
- scalaz.concurrent
An implementation of actors for concurrency
- scalaz.memo
A library for automatic memoisation of computations
Some features that have already been implemented for Scalaz 4
- 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).
- 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