dfunc 0.6.2
dfunc: ^0.6.2 copied to clipboard

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

Functional batteries for Dart programming language.

Provides implementation of Optional, Either and other types + some helper functions.

Usage #

A simple usage example:

import 'package:dfunc/dfunc.dart';

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

  // Either

  final either = Either<Exception, String>.right('test');
  either.isRight() == true;
  either.map((s) => s.toUpperCase()).fold(always(null), identity) == 'TEST';
}

Features and bugs #

Please file feature requests and bugs at the issue tracker.

7
likes
130
pub points
77%
popularity

Publisher

ookamikb.dev

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

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD (LICENSE)

More

Packages that depend on dfunc