maybe_just_nothing 0.0.1 copy "maybe_just_nothing: ^0.0.1" to clipboard
maybe_just_nothing: ^0.0.1 copied to clipboard

outdated

Yet another variation of the Maybe monad written in Dart.

example/example.dart

import 'package:maybe_just_nothing/maybe_just_nothing.dart';

Maybe<int> oddTimes3(int number) =>
    Maybe(number).filter((_) => _.isOdd).map((_) => _ * 3);

void main() {
  oddTimes3(5).ifPresent(print); // Prints 15
  oddTimes3(2).ifPresent(print); // Does nothing
}
7
likes
0
pub points
66%
popularity

Publisher

verified publisherkarapetov.com

Yet another variation of the Maybe monad written in Dart.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

http

More

Packages that depend on maybe_just_nothing