$ luarocks install streams
This library provides a Java-like `Stream` class that provides a fluent interface of lazily-computed and chainable iterator operations such as `map`, `filter`, and `reduce`. For example:
```lua
local fn = require "stream"
fn.stream{2, 3, 4, 7}
:filter(function(x) return x % 2 == 0 end)
:map(function(x) return x ^ 2 end)
:collect() -- {4, 16}
```
Versions
Dependencies
lua >= 5.1