Skip to content
pubscout

dartz

0.10.1, released 5 years ago by an unverified publisher

Functional programming library with monads, immutable collections, and combinators for Dart

WASM-ready
$ flutter pub add dartz
Source repository

What it does

Provides a type‑class hierarchy, persistent collections, Option, Either, State, Tuple, Lens, and a streaming conveyor. It adds many combinators and null‑safe APIs for functional style programming.

AI-written summary of version 0.10.1, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You need pure functional utilities like Option, Either, or immutable collections
  • You want to write null‑safe, stack‑safe code with monadic abstractions
  • You are building libraries that benefit from a functional core

Skip it when

  • You are building UI state‑management solutions that rely on reactive streams or widgets
  • You need a lightweight library with minimal API surface

Strengths

  • Rich set of FP primitives and combinators
  • Full null‑safety support since 0.10.0
  • Good performance on dart2js/node/v8
  • Experimental streaming and lens support

Weaknesses

  • Experimental features may change or be removed
  • Learning curve for functional concepts
  • No built‑in UI or state‑management helpers

Setup

Kind
Pure Dart
Effort
Low
Code generation
No
Direct dependencies
0
import 'package:dartz/dartz.dart';

void main() {
  final opt = some(42);
  final res = opt.map((x) => x * 2);
  print(res); // prints Some(84)
}

Alternatives

Packages that do the same job and could replace dartz.

  • fast_immutable_collections

    Fast immutable lists, sets, maps, and multimaps for Dart

  • fastforge

    Tool for packaging and publishing Flutter applications with support for multiple formats and platforms.

  • dart_style

    Provides an API and CLI to format Dart source code automatically.

  • more

    A collection of utility extensions and specialized data structures for Dart.

Works with

Packages commonly used together with dartz: ones it builds on, ones built on it, and its own family.