FP::Interface - implement an interface
Also see FP::Interfaces.
{ 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; sub foo { } sub fold { } use FP::Interface; FP::Interface::implemented qw(FP::Abstract::ExtendedSequence); FP::Interface::implemented qw(FP::Abstract::Pure); # but, the recommended way is to instead: use FP::Interfaces; FP::Interfaces::implemented qw(FP::Abstract::ExtendedSequence FP::Abstract::Pure); # FP::Interface*::implemented add the given arguments to @ISA # and check that the methods required by those interfaces are # actually implemented. It issues warnings for missing methods, # in this case that 'sum' is not implemented. }
FP::Interfaces
This implements: FP::Abstract::Interface
This is alpha software! Read the status section in the package README or on the website.
To install FunctionalPerl, copy and paste the appropriate command in to your terminal.
cpanm
cpanm FunctionalPerl
CPAN shell
perl -MCPAN -e shell install FunctionalPerl
For more information on module installation, please visit the detailed CPAN module installation guide.