The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.
package MyCodeAttrs;
use MooseX::Attributes::Curried (
    has_guess => sub {
        if (/^\w$/) {
            return {
                isa => 'Int',
                %{$_[0]},
                @{$_[1]},
            };
        }
        else {
            return {
                isa => 'Str',
                %{$_[0]},
                @{$_[1]},
            };
        }
    },
);

1;