compose 0.0.2 copy "compose: ^0.0.2" to clipboard
compose: ^0.0.2 copied to clipboard

outdated

Compose functions in dart(https://en.wikipedia.org/wiki/Function_composition). Try to use it with language operators.

example/example.dart

import 'package:compose/compose.dart';

void main() {
  var addOne = (x) => x + 1;
  var minusOne = (x) => x - 1;
  var add = (x, v) => x + v;

  print(c() >> addOne >> minusOne >> ((_) => add(1, _ * 2)) > 3); // 7
  print(c() >> addOne >> minusOne >> ((_) => add(1, _ * 2)) < 3); // 7

  print(c() * addOne * ((_) => _ * 2) > 4); // 9
  print(c() * addOne * ((_) => _ * 2) < 4); // 10
}
0
likes
0
pub points
9%
popularity

Publisher

unverified uploader

Compose functions in dart(https://en.wikipedia.org/wiki/Function_composition). Try to use it with language operators.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

More

Packages that depend on compose