Specializing attributes
package Number;
use Moose;
has 'num' => ( is => 'ro', isa => 'Num' );
sub round { ... }
package Integer;
use Moose;
extends 'Number';
has '+num' => ( isa => 'Int' );
sub is_prime { ... }
- Here we extend A's num with our +num.
- Restrictions apply, cannot make things more general, only more specific.