dfunc 0.10.0 copy "dfunc: ^0.10.0" to clipboard
dfunc: ^0.10.0 copied to clipboard

Functional batteries for Dart. Implementation of Either, Optional etc.

example/lib/main.dart

import 'package:dfunc/dfunc.dart';

void main() {
  final items = ['a', 'b', 'c'];
  print('mapped: ${mapIndexed((i, e) => '$e$i', items)}');

  // Either

  const either = Either<Exception, String>.right('test');
  // ignore: unnecessary_statements
  either.isRight() == true;
  // ignore: unnecessary_statements
  either.map((s) => s.toUpperCase()).fold(always(null), identity) == 'TEST';
}
16
likes
160
points
3.68k
downloads

Publisher

verified publisherookamikb.dev

Weekly Downloads

Functional batteries for Dart. Implementation of Either, Optional etc.

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-2-Clause (license)

More

Packages that depend on dfunc