dfp 0.3.0 copy "dfp: ^0.3.0" to clipboard
dfp: ^0.3.0 copied to clipboard

A library for typed functional programming in Dart, inspired by Rust.

example/example.dart

import 'dart:io';
import 'dart:math';

import 'package:dfp/dfp.dart';

void main() async {
  final number = fromNullable(stdin.readLineSync())
      .flatMap((value) => fromNullable(double.tryParse(value)))
      .map(sin)
      .filter((value) => value >= 0)
      .map((value) => value * 2)
      .map((value) => value.abs().toStringAsFixed(2));

  print(number.toNullable());
}
0
likes
160
points
47
downloads

Publisher

unverified uploader

Weekly Downloads

A library for typed functional programming in Dart, inspired by Rust.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

More

Packages that depend on dfp