NAME

FP::Interface - implement an interface

SYNOPSIS

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.
}

DESCRIPTION

SEE ALSO

FP::Interfaces

This implements: FP::Abstract::Interface

NOTE

This is alpha software! Read the status section in the package README or on the website.