use MooseX::Declare; class foo { has bar => (is => 'rw', isa => 'Maybe[Str]', ...); ... } # foo