lazylambda

Lambda.* API, but for Iterator
https://github.com/Frixuu/LazyLambda

To install, run:

haxelib install lazylambda 0.1.0 

See using Haxelib in Haxelib documentation for more information.

README.md

<!-- markdownlint-disable no-inline-html -->

Logo
LazyLambda

Functional iterators library for Haxe 4.2 and later.

License Lint status Build status Code coverage %

How to use

using lazylambda.Prelude;
array.iterator()
    .take(10)
    .filter(i -> i < 100)
    .map(i -> Std.string(i + 1))
    .join(", ");

How does it compare to…

  • Lambda, from the standard library: It's in the name. While the standard library functions are eager, that is resolve immediately, LazyLambda only processes the iterators when their items are needed. This approach can be sometimes noticably faster. (Plus, I'm not a fan of its function naming schemes.)
  • yar3333/stdlib: This is a general-purpose library, so it's not a one-to-one comparison, but its facilities seem focused on Arrays specifically instead of iterators in general.
  • SomeRanDev/MagicArrayTools: It's magic! No, literally. If all you need is for your app to be as performant as possible, you won't go wrong with this library. That being said, it's basically one giant macro, and macros tend to have their quirks and special handling requirements. Its code may also be difficult to grasp when wanting to extend it.
  • LPeter1997/itertools: This one is the most similar as it tries to reach exactly the same design goals, BUT it fails, in my opinion, in a one crucial way: its function signatures. They consume and produce Iterables instead of Iterators. This approach needlesly allocates extra wrappers, closures, and generally makes it harder for the compiler to optimize away.
Contributors
frixuu
Version
0.1.0
Published
5 days ago
License
MIT

All libraries are free

Every month, more than a thousand developers use Haxelib to find, share, and reuse code — and assemble it in powerful new ways. Enjoy Haxe; It is great!

Explore Haxe

Haxe Manual

Haxe Code Cookbook

Haxe API documentation

You can try Haxe in the browser! try.haxe.org

Join us on GitHub!

Haxe is being developed on GitHub. Feel free to contribute or report issues to our projects.

Haxe on GitHub

⌂