Data::Monad::List - The List monad.
use Data::Monad::List; my $m = scalar_list(10, 20); $m = $m->flat_map(sub { my $v = shift; scalar_list($v + 1, $v + 2); }); my @result = $m->scalars; # (11, 12, 21, 22)
Data::Monad::List represents non-deterministic values.
This module is marked EXPERIMENTAL. API could be changed without any notice.
Is the same as following lines.
$list = Data::Monad::List->new([$single_values[0]], [$single_values[1]], ...)
These are shorthand of methods which has the same name.
The constructor of this class.
Overrides methods of Data::Monad::Base::MonadZero.
Overrides methods of Data::Monad::Base::Monad.
Retrieves list of values from $list
$list
Retrieves values which was set by the scalar_list method.
scalar_list
hiratara <hiratara {at} cpan.org>
Data::Monad::Base::Monad
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Data::Monad, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Data::Monad
CPAN shell
perl -MCPAN -e shell install Data::Monad
For more information on module installation, please visit the detailed CPAN module installation guide.