dfunc 0.1.8

  • Readme
  • Changelog
  • Example
  • Installing
  • 75

Functional batteries for Dart programming language.

Heavily inspired by such libraries as ramda.js and lodash.

Usage #

A simple usage example:

import 'package:dfunc/dfunc.dart';

main() {
  final items = ['a', 'b', 'c'];
  print('mapped: ${mapIndexed((i, e) => '$e$i', items)}');
}

Features and bugs #

Please file feature requests and bugs at the issue tracker.

0.1.8 #

  • Exported Optional

0.1.7 #

  • Added toOptional() extension method

0.1.6 #

  • Added Optional

0.1.5 #

  • Fixed error in Future

0.1.4 #

  • Added Future
  • FutureEitherExtension functions parameters now return FutureOr

0.1.3 #

  • Added Either::mapAsync function

0.1.2 #

  • Added Either::map function

0.1.1 #

  • Added Either extensions

0.1.0 #

  • Depends on Dart 2.6.0
  • Added Either

0.0.7 #

  • Make sum func generic
  • Added pipe functions

0.0.6 #

  • Added functions:
    • ignore
    • always
    • T
    • F
    • substring
    • limit

0.0.5 #

  • Added functions:
    • map
    • complement
    • isEmpty

0.0.4 #

  • Updated description

0.0.3 #

  • Updated documentation
  • Added tests

0.0.2 #

  • Initial version

example/dfunc_example.dart

import 'package:dfunc/dfunc.dart';

main() {
  final items = ['a', 'b', 'c'];
  print('mapped: ${mapIndexed((i, e) => '$e$i', items)}');
}

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  dfunc: ^0.1.8

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:dfunc/dfunc.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
53
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]
75
Learn more about scoring.

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

  • Dart: 2.7.0
  • pana: 0.13.1+4

Maintenance issues and suggestions

Make sure dartdoc successfully runs on your package's source files. (-10 points)

exitCode: 255 stdout: parsing /tmp/pub-dartlang-dartdocTPFMIL/pkg/lib/dfunc.dart... parsing /dart-sdk/lib/core/core.dart... parsing /dart-sdk/lib/collection/collection.dart... parsing /dart-sdk/lib/internal/internal.dart... parsing /dart-sdk/lib/async/async.dart... parsing /dart-sdk/lib/convert/convert.dart... parsing /dart-sdk/lib/typed_data/typed_data.dart... parsing /dart-sdk/lib/math/math.dart... parsing /tmp/pub-dartlang-dartdocTPFMIL/pkg/lib/src/always.dart... parsing /tmp/pub-dartlang-dartdocTPFMIL/pkg/lib/src/complement.dart... parsing /tmp/pub-dartlang-dartdocTPFMIL/pkg/lib/src/either.dart... parsing /tmp/pub-dartlang-dartdocTPFMIL/pkg/lib/src/f.dart... parsing /tmp/pub-dartlang-dartdocTPFMIL/pkg/lib/src/identity.dart... parsing /tmp/pub-dartlang-dartdocTPFMIL/pkg/lib/src/if_not_null.dart... parsing /tmp/pub-dartlang-dartdocTPFMIL/pkg/lib/src/ignore.dart... parsing /tmp/pub-dartlang-dartdocTPFMIL/pkg/lib/src/is_empty.dart... parsing /tmp/pub-dartlang-dartdocTPFMIL/pkg/lib/src/limit.dart... parsing /tmp/pub-dartlang-dartdocTPFMIL/pkg/lib/src/map.dart... parsing /tmp/pub-dartlang-dartdocTPFMIL/pkg/lib/src/map_by.dart... parsing /tmp/pub-dartlang-dartdocTPFMIL/pkg/lib/src/map_indexed.dart... [...] parsing /dart-sdk/lib/_internal/js_runtime/lib/shared/recipe_syntax.dart... parsing /dart-sdk/lib/js_util/dart2js/js_util_dart2js.dart... parsing /dart-sdk/lib/html/html_common/metadata.dart... parsing /dart-sdk/lib/indexed_db/dart2js/indexed_db_dart2js.dart... parsing /dart-sdk/lib/svg/dart2js/svg_dart2js.dart... parsing /dart-sdk/lib/web_audio/dart2js/web_audio_dart2js.dart... parsing /dart-sdk/lib/web_sql/dart2js/web_sql_dart2js.dart... parsing /dart-sdk/lib/_http/http.dart... parsing /dart-sdk/lib/io/io.dart... parsing /dart-sdk/lib/js/dart2js/js_dart2js.dart... parsing /dart-sdk/lib/js/_js.dart... parsing /dart-sdk/lib/mirrors/mirrors.dart... parsing /dart-sdk/lib/html/dartium/nativewrappers.dart... parsing /dart-sdk/lib/cli/cli.dart... parsing /dart-sdk/lib/wasm/wasm.dart... parsing /dart-sdk/lib/_internal/js_runtime/lib/js_primitives.dart... parsing /dart-sdk/lib/_internal/js_runtime/lib/shared/async_await_error_codes.dart... Initialized dartdoc with 55 libraries in 37.7 seconds documenting dfunc Generating docs for library dfunc from package:dfunc/dfunc.dart... stderr: Documenting dfunc... warning: dfunc has no library level documentation comments, from dfunc: (file:///tmp/pub-dartlang-dartdocTPFMIL/pkg/lib/dfunc.dart:1:9) Unhandled exception: type 'DynamicTypeImpl' is not a subtype of type 'InterfaceType' #0 TypeParameterElementType.interfaceType (package:dartdoc/src/element_type.dart:261:38) #1 DefinedElementType.instantiatedType (package:dartdoc/src/element_type.dart:331:12) #2 Extension._couldApplyTo (package:dartdoc/src/model.dart:1350:47) #3 Extension.couldApplyTo (package:dartdoc/src/model.dart:1346:33) #4 Class.potentiallyApplicableExtensions.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.6.0 <3.0.0
Dev dependencies
pedantic ^1.7.0
test ^1.6.0