Data::Monad::Control - Exception handling with Monad
use Data::Monad::Control qw( try ); my $result = try { write_to_file_may_die(...); }; # => Data::Monad::Either $result->flat_map(sub { # ... });
Data::Monad::Control provides some functions to handle exceptions with monad.
Takes a function that will die with some exception and runs it.
Returns a left Either monad contains the exception if some exception caught, otherwise, returns a right Either monad contains the values from the given function.
Copyright (C) aereal.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
aereal <aereal@aereal.org>
Data::Monad, Try::Tiny
To install Data::Monad::Control, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Data::Monad::Control
CPAN shell
perl -MCPAN -e shell install Data::Monad::Control
For more information on module installation, please visit the detailed CPAN module installation guide.