NAME
Function::Interface - specify type constraints of subroutines
SYNOPSIS
package IFoo {
use Function::Interface;
use Types::Standard -types;
fun hello(Str $msg) :Return(Str);
}
and implements interface class:
package Foo {
use Function::Interface::Impl qw(IFoo);
use Function::Parameters;
use Function::Return;
use Types::Standard -types;
fun hello(Str $msg) :Return(Str) {
return "HELLO $msg";
}
}
DESCRIPTION
Function::Interface provides Interface like Java and checks the arguments and return type of the function at compile time.
LICENSE
Copyright (C) kfly8.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
AUTHOR
kfly8 <kfly@cpan.org>