Typed functional piping in Dart. Please message or contact on github if you have any suggestions. This may very well not be production ready...it might even be a bad idea! It is really just a play thing but my intention was to model the piping functionality in Haskell.
C(initial value).x(first function).x(second function).execute(); var result = C(6) .x0(addOne) .x2(addTwoNumbers, 4, 5) .x1(addNumber, 3) .x0(addOne) .x1(addNumber, 4) .$(); //we need this last function to exectue the composition
Todo / might do later #
- just use one class (and the initial value can be created by a static function)
- output a function (although could use compose dartz for that)
- Cannot implement the >> operator because operator generics are not possible in Dart at the moment (possibly ever due to syntax problems)
This is just a playful thing, nothing serious!
- Allow parameters
- Renamed x to x0 so the functions stack up nicely as in test 5
- Update readme with todos
- Update readme and fix an import naming bug
//see the test folder for examples of how to use
Use this package as a library
1. Depend on it
Add this to your package's pubspec.yaml file:
dependencies: fn_compose: ^0.1.0
2. Install it
You can install packages from the command line:
$ pub get
$ flutter pub get
Alternatively, your editor might support
pub get or
flutter pub get.
Check the docs for your editor to learn more.
3. Import it
Now in your Dart code, you can use:
import 'package:fn_compose/compose.dart'; import 'package:fn_compose/composefn.dart';
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
We analyzed this package on Feb 27, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:
- Dart: 2.7.1
- pana: 0.13.5
dartfmt to format
dartfmt to format
The description is too long. (-10 points)
Search engines display only the first part of the description. Try to keep the value of the
description field in your package's
pubspec.yaml file between 60 and 180 characters.
Package is getting outdated. (-9.32 points)
The package was last published 57 weeks ago.
|Dart SDK||>=2.1.0 <3.0.0|