
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.
Represents the value of this class.
Overrides methods of Data::Monad::Base::Monad.

hiratara <hiratara {at} cpan.org>


This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.