Data::Monad::Singleton - The singleton monad.
use Data::Monad::Singleton; my $singleton = Data::Monad::Singleton->unit("Hello") ->flat_map(sub { length $_[0] }); $singleton == singleton and die "All operations are ignored.";
Data::Monad::Singleton maps all values to the one value. It collapses the structure of original computations.
Represents the value of this class.
Overrides methods of Data::Monad::Base::Monad.
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.