diene_result 1.0.0
diene_result: ^1.0.0 copied to clipboard
Sealed Result and Option types with C0-compatible wire codecs for Dart applications.
diene_result #
Sealed, synchronous Result<T> and Option<T> values for Dart, with
C0-compatible tagged-array wire codecs and a dependency-light consumer test
helper.
import 'package:diene_problems/diene_problems.dart';
import 'package:diene_result/diene_result.dart';
final Result<int> result = Result<int>.ok(21)
.map((value) => value * 2)
.andThen((value) => Result<int>.ok(value));
final String message = result.match(
ok: (value) => 'answer: $value',
err: (Problem problem) => problem.title,
);
The error channel is the sole RFC 9457 Problem identity owned and exported by
diene_problems; diene_result depends on that package and does not define or
re-export a competing envelope. serial() emits the C0 tagged arrays:
['ok', value]/['err', problemJson]['some', value]/['none', null]
Import package:diene_result/test_helper.dart in consumer tests for
expectOk, expectErr, expectSome, and expectNone. The sub-library has no
test-framework dependencies and adds no runtime dependency beyond the package's
canonical diene_problems edge.
Read the Result standard for the complete API, wire contract, TestHelper guidance, and deliberate Bun-family deltas.
Development #
pls setupresolves the workspace dependencies.pls testruns unit, C0 conformance, and TestHelper meta suites.pls test:coverageenforces the separate unit and meta ledgers.pls deadcoderuns repository and production-only dead-code passes.pls package:validateruns the release guard, publish dry-run, and pana.