Flux::Simple - functional-style stream generators
version 1.03
use Flux::Simple qw( array_in array_out mapper ); my $mapper = mapper { shift() * 3 }; say $mapper->write(10); # 30 my $in = array_in([ 5,6,7 ]); say $in->read; # 5 my @data; my $out = array_out(\@data); # writes to $out will populate @data
Create an input stream which shifts items from a specified arrayref and returns them as values.
Create an output stream which puts items into specified arrayref on writes.
Create an anonymous mapper which calls &write_cb on each item.
&write_cb
If &flush_cb is provided, it will be called at the commit step and its results will be used too (but remember that flushable mappers can't be attached to input streams).
&flush_cb
Vyacheslav Matyukhin <me@berekuk.ru>
This software is copyright (c) 2013 by Yandex LLC.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install Flux, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Flux
CPAN shell
perl -MCPAN -e shell install Flux
For more information on module installation, please visit the detailed CPAN module installation guide.