fn_compose 0.1.0

  • Readme
  • Changelog
  • Example
  • Installing
  • 47

fn_compose #

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.

Examples #

C(initial value).x(first function).x(second function).execute();

var result = C(6)
    .x2(addTwoNumbers, 4, 5)
    .x1(addNumber, 3)
    .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!

0.1.0 #

  • Allow parameters
  • Renamed x to x0 so the functions stack up nicely as in test 5

0.0.3 #

  • Update readme with todos

0.0.2 #

  • 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:

  fn_compose: ^0.1.0

2. Install it

You can install packages from the command line:

with pub:

$ pub get

with Flutter:

$ 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]
Learn more about scoring.

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

Health suggestions

Format lib/compose.dart.

Run dartfmt to format lib/compose.dart.

Format lib/composefn.dart.

Run dartfmt to format lib/composefn.dart.

Maintenance suggestions

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.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
Dev dependencies
test ^1.0.0