itertools 0.2.0 copy "itertools: ^0.2.0" to clipboard
itertools: ^0.2.0 copied to clipboard

outdated

Package for advanced simple and easy work with Dart iterators

itertools · build status #

Simple package for easy work with Dart iterators just like Python itertools.

Provide methods / functions:

  • zip2/zip3/etc
  • chain
  • count
  • enumerate / mapIndexed
  • and other helpers

Pub dev

Documentation

Issue tracker

Usage #

import 'package:itertools/itertools.dart';

void main() {
  print(zip2(['H', ',', 'a', 'l'], ['i', ' ', 'l', '!'])
      .map((e) => e.item1 + e.item2)
      .join());
  // output: Hi, all!

  print(range(first: 1, last: 10, step: 3).reversed.toList());
  // output: [7, 4, 1]

  // or more compact

  print(1.to(10, step: 3).reversed.toList());
  // output: [7, 4, 1]

  print(chain(1.to(4), [4, 5], 1.to(4)).toList());
  // output: [1, 2, 3,  4, 5,  1, 2, 3]
}

Features and bugs #

Please file feature requests and bugs at the issue tracker.

5
likes
0
pub points
54%
popularity

Publisher

unverified uploader

Package for advanced simple and easy work with Dart iterators

Homepage
Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

tuple_dart

More

Packages that depend on itertools