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

outdated

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 str = Option.fromNullable(stdin.readLineSync());
  final number = Option.flatten(
    str.map((value) => Option.fromNullable(double.tryParse(value))),
  );
  final fixed = number
      .map(sin)
      .map((value) => value * 2)
      .map((value) => value.abs().toStringAsFixed(2));
  print(fixed.toNullable());
}
0
likes
0
points
47
downloads

Publisher

unverified uploader

Weekly Downloads

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

Repository (GitHub)
View/report issues

License

unknown (license)

More

Packages that depend on dfp