Scalaz is a Scala library for functional programming. It adds purely functional data structures, type classes, and instances for common Scala and Java types.
Overview
Scalaz extends Scala with functional programming primitives beyond the standard library. It provides data structures and a hierarchy of type classes such as Functor and Monad, with instances wired for many types.
The library is modular: a core module holds type classes, structures, and standard-library instances; separate modules cover effects and iteratee-style processing. Type class instances live under scalaz.std rather than in each type class companion, and syntax helpers live in scalaz.syntax for optional extension-method imports.
Version 7 reorganized implicit scope, instance definition, and syntax to reduce ambiguity and support standalone type class use without implicit enrichment. Monad transformers and additional structures broaden what you can express in purely functional style.
You add Scalaz through SBT or Maven from published artifacts. Builds target Scala 2.12, 2.13, 3.x, Scala.js, and Scala Native as described in the getting-started notes.
Key features
- Functor, Monad, and related type classes
- Purely functional data structures
- Instances for Scala and Java std types
- Modular core, effect, and iteratee artifacts
- Selectable syntax imports in scalaz.syntax
- Monad transformer support
- Cross-built for Scala.js, Scala Native
- Standalone type class call style
Use cases
- Functional domain modeling in Scala
- Composable effect and IO-style code
- Teaching Scala type class patterns
- Libraries needing functional programming abstractions