dartz
0.10.1, released 5 years ago by an unverified publisher
Functional programming library with monads, immutable collections, and combinators for Dart
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
91Compare - fastforge
Tool for packaging and publishing Flutter applications with support for multiple formats and platforms.
80Compare - dart_style
Provides an API and CLI to format Dart source code automatically.
89Compare - more
A collection of utility extensions and specialized data structures for Dart.
90Compare
Works with
Packages commonly used together with dartz: ones it builds on, ones built on it, and its own family.
- search_cepBuilt on dartzClient for Brazilian CEP lookup via via_cep and Postmon APIs
- iconify_designBuilt on dartzUse icons from the Iconify.design API in Flutter applications.
- nullxBuilt on dartzCollection of extensions for handling null types in Dart.
- contentfulBuilt on dartzA Dart client for the Contentful Delivery API.
- any_animated_buttonBuilt on dartzAn expandable button that animates between idle, progress, success, and error states using BLoC.