Data::Monad::Base::MonadZero - The base class of monads which have the zero.
package YourMonadClass; use base qw/Data::Monad::Base::MonadZero/; sub unit { my ($class, @v) = @_; ... } sub flat_map { my ($self, $f) = @_; ... } sub zero { my $class = shift; ... }
Data::Monad::Base::MonadZero has the zero element which will not be changed by any monadic operations.
You must implement zero() according to some of monadplus laws.
Represents the zero value.
Filters values by predicates. If the predicate returns false, filter will use the zero value.
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.