本間 雅洋 (Masahiro Honma) > Data-Monad-0.04 > Data::Monad::Identity

Download:
Data-Monad-0.04.tar.gz

Dependencies

Annotate this POD

Website

View/Report Bugs
Source   Latest Release: Data-Monad-0.07

NAME ^

Data::Monad::Identity - The identity monad.

SYNOPSIS ^

  use Data::Monad::Identity;

  my $m = Data::Monad::Identity->new(3, 5)->map(sub { $_[0] + $_[1] });
  print $m->value, "\n";  # 8

DESCRIPTION ^

Data::Monad::Identity doesn't nothing. It just wraps values.

METHODS ^

$m = Data::Monad::Identity->new(@v);

Makes the new value which represents @v.

unit
flat_map

Overrides methods of Data::Monad::Base::Monad.

@v = $m->value;

Retrieves wrapped values from this object.

AUTHOR ^

hiratara <hiratara {at} cpan.org>

SEE ALSO ^

Data::Monad::Base::Monad

LICENSE ^

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

syntax highlighting: