fn_compose 0.1.0

  • README.md
  • CHANGELOG.md
  • Example
  • Installing
  • Versions
  • 48

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)
    .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!

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

example/example.dart

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

with pub:


$ pub get

with Flutter:


$ flutter packages get

Alternatively, your editor might support pub get or flutter packages 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';
  
Version Uploaded Documentation Archive
0.1.0 Jan 23, 2019 Go to the documentation of fn_compose 0.1.0 Download fn_compose 0.1.0 archive
0.0.3 Dec 5, 2018 Go to the documentation of fn_compose 0.0.3 Download fn_compose 0.0.3 archive
0.0.2 Dec 5, 2018 Go to the documentation of fn_compose 0.0.2 Download fn_compose 0.0.2 archive
0.0.1 Dec 5, 2018 Go to the documentation of fn_compose 0.0.1 Download fn_compose 0.0.1 archive
Popularity:
Describes how popular the package is relative to other packages. [more]
0
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
90
Overall:
Weighted score of the above. [more]
48
Learn more about scoring.

We analyzed this package on Apr 25, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.2.0
  • pana: 0.12.14

Platforms

Detected platforms: Flutter, web, other

No platform restriction found in libraries.

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.

Dependencies

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