NAME
FP::Interfaces - implement interfaces
SYNOPSIS
{
package FP::Abstract::Sequence;
sub fp_interface_method_names {
qw(fold)
}
}
{
package FP::Abstract::ExtendedSequence;
use base qw(FP::Abstract::Sequence);
sub fp_interface_method_names {
my $class= shift;
(qw(sum), $class->SUPER::fp_interface_method_names)
}
}
{
package Foo;
use FP::Interfaces;
FP::Interfaces::implemented qw(FP::Abstract::ExtendedSequence
FP::Abstract::Pure);
# FP::Interfaces::implemented adds the given arguments to @ISA
# and checks that the methods required by those interfaces are
# actually implemented. It issues warnings for missing methods,
# in this case that 'sum' is not implemented.
sub foo { }
sub fold { }
}
DESCRIPTION
NOTE
This is alpha software! Read the package README.