view release on metacpan or search on metacpan
Revision history for Perl extension Aion
2.6 2026-11-27T18:15:03Z
- types `Uni` and `Bin` redefined: `Uni` is a string with the utf8 flag or with chars < 128, `Bin` is a string without the utf8 flag
- fixed export of Aion main functions (`has`, `with`, `have`, `havelock`, etc.) when the package does not see them via `UNIVERSAL::can`
- `Aion::Meta::Subroutine->compare` accepts narrowed types in the second signature (`Int` instead of `Num`) and reports signature mismatch
2.5 2026-11-24T08:03:50Z
- fix bug with req without isa and has with isa
2.4 2026-09-23T14:50:46Z
i18n/Aion/Types.ru-en.po view on Meta::CPAN
msgid "ÐпÑеделÑÐµÑ Ð·Ð½Ð°Ñение Ð´Ð»Ð¸Ð½Ñ Ð¾Ñ `from` или 0 до `to`."
msgstr "Specifies a length value from `from` or 0 to `to`."
msgid "Perl веÑÑии."
msgstr "Perl version."
msgid "СÑÑоки, вклÑÑÐ°Ñ ÑиÑла."
msgstr "Strings, including numbers."
msgid "СÑÑоки Ñ Ñлагом utf8 или Ñ Ð½Ð¾Ð¼ÐµÑами Ñимволов менÑÑе 128."
msgstr "Lines with the utf8 flag or with character numbers less than 128."
msgid "СÑÑоки без Ñлага utf8."
msgstr "Lines without the utf8 flag."
msgid "СÑÑока наÑинаеÑÑÑ Ñ `begin`."
msgstr "The line starts with `begin`."
msgid "СÑÑока заканÑиваеÑÑÑ Ð½Ð° `end`."
msgstr "The line ends with `end`."
msgid "СÑÑока Ñ Ð¾Ð´Ð½Ð¸Ð¼ или неÑколÑкими Ñимволами, не ÑвлÑÑÑимиÑÑ Ð¿Ñобелами."
msgstr "A string containing one or more non-blank characters."
lib/Aion/Types.md view on Meta::CPAN
СÑÑоки, вклÑÑÐ°Ñ ÑиÑла.
```perl
1.1 ~~ Str # -> 1
"" ~~ Str # -> 1
1.1.0 ~~ Str # -> ""
```
## Uni
СÑÑоки Ñ Ñлагом utf8 или Ñ Ð½Ð¾Ð¼ÐµÑами Ñимволов менÑÑе 128.
```perl
"â" ~~ Uni # -> 1
123 ~~ Uni # -> 1
do {no utf8; "â" ~~ Uni} # -> ""
```
## Bin
СÑÑоки без Ñлага utf8.
```perl
123 ~~ Bin # -> 1
"z" ~~ Bin # -> 1
"â" ~~ Bin # -> ""
do {no utf8; "â" ~~ Bin } # -> 1
```
## StartsWith\[begin]
СÑÑока наÑинаеÑÑÑ Ñ `begin`.
```perl
"Hi, world!" ~~ StartsWith["Hi,"]; # -> 1
"Hi world!" ~~ StartsWith["Hi,"]; # -> ""
```
lib/Aion/Types.pm view on Meta::CPAN
Bool()->include($m ? $m->($_) : $_) };
subtype "Enum[e...]", as &Item,
init_where { M = +{ map {($_ => $_)} ARGS } }
where { exists M->{$_} };
subtype "Undef", as &Item, where { !defined $_ };
subtype "Maybe[A]", as &Undef | A;
subtype "Defined", as &Item, where { defined $_ };
subtype "Value", as &Defined, where { "" eq ref $_ };
subtype "Version", as &Value, where { "VSTRING" eq ref \$_ };
subtype "Str", as &Value, where { "SCALAR" eq ref \$_ };
subtype "Uni", as &Str, where { utf8::is_utf8($_) || !/[\x80-\xFF]/a };
subtype "Bin", as &Str, where { !utf8::is_utf8($_) };
subtype "NonEmptyStr", as &Str, where { /\S/ };
subtype "StartsWith[start]", as &Str,
init_where { M = qr/^${\ quotemeta A}/ },
where { $_ =~ M };
subtype "EndsWith[end]", as &Str,
init_where { N = qr/${\ quotemeta A}$/ },
where { $_ =~ N };
subtype "Email", as &Str, where { /@/ };
subtype "Tel", as &Str, where { /^\+\d{7,}\z/ };
subtype "Url", as &Str, where { /^https?:\/\// };
subtype "Path", as &Str, where { /^\// };
subtype "Html", as &Str, where { /^\s*<(!doctype\s+html|html)\b/i };
subtype "StrDate", as &Str, where { /^\d{4}-\d{2}-\d{2}\z/ };
subtype "StrDateTime", as &Str, where { /^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}\z/ };
subtype "StrMatch[regexp]", as &Str, where { $_ =~ A };
subtype "PackageName", as &Str, where { no utf8; use bytes; /^(?:[a-z]\w*(?:::[a-z]\w*)*)\z/ia };
subtype "ClassName", as &PackageName, where { !!$_->can('new') };
subtype "RoleName", as &PackageName, where { !$_->can('new') && !!(@{"$_\::ISA"} || first { *{$_}{CODE} } values %{"$_\::"}) };
subtype "StrRat", as &Str, where { m!\s*/\s*!? &Num->include($`) && &Num->include($`): &Num->test };
subtype "Num", as &Str, where { looks_like_number($_) && /[\dfn]\z/i };
subtype "Int", as &Num, where { /^[-+]?\d+\z/ };
subtype "Ref", as &Defined, where { "" ne ref $_ };
subtype "Tied`[class]", as &Ref,
where { my $ref = reftype($_); !!(
$ref eq "HASH"? tied %$_:
lib/Aion/Types.pm view on Meta::CPAN
=head2 Str
Strings, including numbers.
1.1 ~~ Str # -> 1
"" ~~ Str # -> 1
1.1.0 ~~ Str # -> ""
=head2 Uni
Lines with the utf8 flag or with character numbers less than 128.
"â" ~~ Uni # -> 1
123 ~~ Uni # -> 1
do {no utf8; "â" ~~ Uni} # -> ""
=head2 Bin
Lines without the utf8 flag.
123 ~~ Bin # -> 1
"z" ~~ Bin # -> 1
"â" ~~ Bin # -> ""
do {no utf8; "â" ~~ Bin } # -> 1
=head2 StartsWith[begin]
The line starts with C<begin>.
"Hi, world!" ~~ StartsWith["Hi,"]; # -> 1
"Hi world!" ~~ StartsWith["Hi,"]; # -> ""
=head2 EndsWith[end]
use common::sense; use open qw/:std :utf8/; use Carp qw//; use Cwd qw//; use File::Basename qw//; use File::Find qw//; use File::Slurper qw//; use File::Spec qw//; use File::Path qw//; use Scalar::Util qw//; use Test::More 0.98; use String::Diff q...
# # NAME
#
# Aion - поÑÑмодеÑниÑÑÑÐºÐ°Ñ Ð¾Ð±ÑекÑÐ½Ð°Ñ ÑиÑÑема Ð´Ð»Ñ Perl 5, ÑÐ°ÐºÐ°Ñ ÐºÐ°Ðº «Mouse», «Moose», «Moo», «Mo» и «M», но Ñ ÑлÑÑÑениÑми
#
# # VERSION
#
# 2.5
#
# # SYNOPSIS
#
t/aion/meta/feature-construct.t view on Meta::CPAN
use common::sense; use open qw/:std :utf8/; use Carp qw//; use Cwd qw//; use File::Basename qw//; use File::Find qw//; use File::Slurper qw//; use File::Spec qw//; use File::Path qw//; use Scalar::Util qw//; use Test::More 0.98; use String::Diff q...
# # NAME
#
# Aion::Meta::FeatureConstruct - конÑÑÑÑкÑÐ¾Ñ Ð°ÐºÑеÑÑоÑа, пÑедикаÑа, иниÑиализаÑоÑа и оÑиÑÑиÑелÑ
#
# # SYNOPSIS
#
subtest 'SYNOPSIS' => sub {
use Aion::Meta::FeatureConstruct;
our $construct = Aion::Meta::FeatureConstruct->new('My::Package', 'my_feature');
t/aion/meta/feature.t view on Meta::CPAN
use common::sense; use open qw/:std :utf8/; use Carp qw//; use Cwd qw//; use File::Basename qw//; use File::Find qw//; use File::Slurper qw//; use File::Spec qw//; use File::Path qw//; use Scalar::Util qw//; use Test::More 0.98; use String::Diff q...
# # NAME
#
# Aion::Meta::Feature - меÑаопиÑаÑÐµÐ»Ñ ÑиÑи
#
# # SYNOPSIS
#
subtest 'SYNOPSIS' => sub {
use Aion::Meta::Feature;
our $feature = Aion::Meta::Feature->new("My::Package", "my_feature" => (is => 'rw'));
t/aion/meta/requires-any-function.pm view on Meta::CPAN
use common::sense; use open qw/:std :utf8/; use Carp qw//; use File::Basename qw//; use File::Find qw//; use File::Slurper qw//; use File::Spec qw//; use File::Path qw//; use Scalar::Util qw//; use Test::More 0.98; BEGIN { $SIG{__DIE__} = sub ...
#
# use common::sense;
#
# use Aion::Meta::Util qw//;
#
# Aion::Meta::Util::create_getters(qw/pkg name/);
#
# sub new {
# my $cls = shift;
# bless {@_}, ref $cls || $cls;
t/aion/meta/requires-any-function.t view on Meta::CPAN
use common::sense; use open qw/:std :utf8/; use Carp qw//; use Cwd qw//; use File::Basename qw//; use File::Find qw//; use File::Slurper qw//; use File::Spec qw//; use File::Path qw//; use Scalar::Util qw//; use Test::More 0.98; use String::Diff q...
# # NAME
#
# Aion::Meta::RequiresAnyFunction - опÑеделÑÐµÑ Ð»ÑбÑÑ ÑÑнкÑиÑ, коÑоÑÐ°Ñ Ð´Ð¾Ð»Ð¶Ð½Ð° бÑÑÑ Ð² модÑле
#
# # SYNOPSIS
#
subtest 'SYNOPSIS' => sub {
use Aion::Meta::RequiresAnyFunction;
my $any_function = Aion::Meta::RequiresAnyFunction->new(
t/aion/meta/requires-feature.pm view on Meta::CPAN
use common::sense; use open qw/:std :utf8/; use Carp qw//; use File::Basename qw//; use File::Find qw//; use File::Slurper qw//; use File::Spec qw//; use File::Path qw//; use Scalar::Util qw//; use Test::More 0.98; BEGIN { $SIG{__DIE__} = sub ...
#
# use common::sense;
#
# use Aion::Meta::Util qw//;
# use List::Util qw/pairmap/;
# use Scalar::Util qw/looks_like_number reftype blessed refaddr/;
#
# Aion::Meta::Util::create_getters(qw/pkg name opt has/);
#
# # ÐонÑÑÑÑкÑоÑ
t/aion/meta/requires-feature.t view on Meta::CPAN
use common::sense; use open qw/:std :utf8/; use Carp qw//; use Cwd qw//; use File::Basename qw//; use File::Find qw//; use File::Slurper qw//; use File::Spec qw//; use File::Path qw//; use Scalar::Util qw//; use Test::More 0.98; use String::Diff q...
# # NAME
#
# Aion::Meta::RequiresFeature - ÑÑебование ÑиÑи Ð´Ð»Ñ Ð¸Ð½ÑеÑÑейÑов
#
# # SYNOPSIS
#
subtest 'SYNOPSIS' => sub {
use Aion::Types qw(Str);
use Aion::Meta::RequiresFeature;
use Aion::Meta::Feature;
t/aion/meta/subroutine.t view on Meta::CPAN
use common::sense; use open qw/:std :utf8/; use Carp qw//; use Cwd qw//; use File::Basename qw//; use File::Find qw//; use File::Slurper qw//; use File::Spec qw//; use File::Path qw//; use Scalar::Util qw//; use Test::More 0.98; use String::Diff q...
# # NAME
#
# Aion::Meta::Subroutine - опиÑÑÐ²Ð°ÐµÑ ÑÑнкÑÐ¸Ñ Ñ ÑигнаÑÑÑой
#
# # SYNOPSIS
#
subtest 'SYNOPSIS' => sub {
use Aion::Types qw(Int);
use Aion::Meta::Subroutine;
t/aion/meta/util.t view on Meta::CPAN
use common::sense; use open qw/:std :utf8/; use Carp qw//; use Cwd qw//; use File::Basename qw//; use File::Find qw//; use File::Slurper qw//; use File::Spec qw//; use File::Path qw//; use Scalar::Util qw//; use Test::More 0.98; use String::Diff q...
# # NAME
#
# Aion::Meta::Util - вÑпомогаÑелÑнÑе ÑÑнкÑии Ð´Ð»Ñ ÑÐ¾Ð·Ð´Ð°Ð½Ð¸Ñ Ð¼ÐµÑа-даннÑÑ
#
# # SYNOPSIS
#
subtest 'SYNOPSIS' => sub {
package My::Meta::Class {
use Aion::Meta::Util;
t/aion/pleroma.t view on Meta::CPAN
use common::sense; use open qw/:std :utf8/; use Carp qw//; use Cwd qw//; use File::Basename qw//; use File::Find qw//; use File::Slurper qw//; use File::Spec qw//; use File::Path qw//; use Scalar::Util qw//; use Test::More 0.98; use String::Diff q...
# # NAME
#
# Aion::Pleroma - конÑÐµÐ¹Ð½ÐµÑ Ñонов
#
# # SYNOPSIS
#
subtest 'SYNOPSIS' => sub {
use Aion::Pleroma;
my $pleroma = Aion::Pleroma->new;
t/aion/type.t view on Meta::CPAN
use common::sense; use open qw/:std :utf8/; use Carp qw//; use Cwd qw//; use File::Basename qw//; use File::Find qw//; use File::Slurper qw//; use File::Spec qw//; use File::Path qw//; use Scalar::Util qw//; use Test::More 0.98; use String::Diff q...
# # NAME
#
# Aion::Type - клаÑÑ Ð²Ð°Ð»Ð¸Ð´Ð°ÑоÑов
#
# # SYNOPSIS
#
subtest 'SYNOPSIS' => sub {
use Aion::Type;
use Aion::Types qw//;
t/aion/type/d-n-f.t view on Meta::CPAN
use common::sense; use open qw/:std :utf8/; use Carp qw//; use Cwd qw//; use File::Basename qw//; use File::Find qw//; use File::Slurper qw//; use File::Spec qw//; use File::Path qw//; use Scalar::Util qw//; use Test::More 0.98; use String::Diff q...
# # NAME
#
# Aion::Type::DNF - пÑиведение Ñипа-вÑÑÐ°Ð¶ÐµÐ½Ð¸Ñ Ðº ÐÐФ ÑквиваленÑнÑми пÑеобÑазованиÑми
#
# # SYNOPSIS
#
subtest 'SYNOPSIS' => sub {
use Aion::Types qw/Range None/;
my $gap = Range[-10, 0] & Range[4, 8];
t/aion/type/lim.t view on Meta::CPAN
use common::sense; use open qw/:std :utf8/; use Carp qw//; use Cwd qw//; use File::Basename qw//; use File::Find qw//; use File::Slurper qw//; use File::Spec qw//; use File::Path qw//; use Scalar::Util qw//; use Test::More 0.98; use String::Diff q...
#
# Aion::Type::Lim - гÑаниÑа Ñо ÑмеÑением Ð´Ð»Ñ Ð¸Ð½ÑеÑвалов
#
# # SYNOPSIS
#
subtest 'SYNOPSIS' => sub {
use Aion::Type::Lim;
local ($::_g0 = do {Aion::Type::Lim->from(5)}, $::_e0 = "Closed[5]"); ::ok $::_g0 eq $::_e0, 'Aion::Type::Lim->from(5) # => Closed[5]' or ::diag ::_string_diff($::_g0, $::_e0); undef $::_g0; undef $::_e0;
local ($::_g0 = do {Aion::Type::Lim->from(5)->inc}, $::_e0 = "Opened[5]"); ::ok $::_g0 eq $::_e0, 'Aion::Type::Lim->from(5)->inc # => Opened[5]' or ::diag ::_string_diff($::_g0, $::_e0); undef $::_g0; undef $::_e0;
t/aion/types.t view on Meta::CPAN
use common::sense; use open qw/:std :utf8/; use Carp qw//; use Cwd qw//; use File::Basename qw//; use File::Find qw//; use File::Slurper qw//; use File::Spec qw//; use File::Path qw//; use Scalar::Util qw//; use Test::More 0.98; use String::Diff q...
# # NAME
#
# Aion::Types - библиоÑека ÑÑандаÑÑнÑÑ
валидаÑоÑов и ÑлÑÐ¶Ð¸Ñ Ð´Ð»Ñ ÑÐ¾Ð·Ð´Ð°Ð½Ð¸Ñ Ð½Ð¾Ð²ÑÑ
валидаÑоÑов
#
# # SYNOPSIS
#
subtest 'SYNOPSIS' => sub {
use Aion::Types;
BEGIN {
t/aion/types.t view on Meta::CPAN
# СÑÑоки, вклÑÑÐ°Ñ ÑиÑла.
#
::done_testing; }; subtest 'Str' => sub {
local ($::_g0 = do {1.1 ~~ Str}, $::_e0 = do {1}); ::ok defined($::_g0) == defined($::_e0) && $::_g0 eq $::_e0, '1.1 ~~ Str # -> 1' or ::diag ::_struct_diff($::_g0, $::_e0); undef $::_g0; undef $::_e0;
local ($::_g0 = do {"" ~~ Str}, $::_e0 = do {1}); ::ok defined($::_g0) == defined($::_e0) && $::_g0 eq $::_e0, '"" ~~ Str # -> 1' or ::diag ::_struct_diff($::_g0, $::_e0); undef $::_g0; undef $::_e0;
local ($::_g0 = do {1.1.0 ~~ Str}, $::_e0 = do {""}); ::ok defined($::_g0) == defined($::_e0) && $::_g0 eq $::_e0, '1.1.0 ~~ Str # -> ""' or ::diag ::_struct_diff($::_g0, $::_e0); undef $::_g0; undef $::_e0;
#
# ## Uni
#
# СÑÑоки Ñ Ñлагом utf8 или Ñ Ð½Ð¾Ð¼ÐµÑами Ñимволов менÑÑе 128.
#
::done_testing; }; subtest 'Uni' => sub {
local ($::_g0 = do {"â" ~~ Uni}, $::_e0 = do {1}); ::ok defined($::_g0) == defined($::_e0) && $::_g0 eq $::_e0, '"â" ~~ Uni # -> 1' or ::diag ::_struct_diff($::_g0, $::_e0); undef $::_g0; undef $::_e0;
local ($::_g0 = do {123 ~~ Uni}, $::_e0 = do {1}); ::ok defined($::_g0) == defined($::_e0) && $::_g0 eq $::_e0, '123 ~~ Uni # -> 1' or ::diag ::_struct_diff($::_g0, $::_e0); undef $::_g0; undef $::_e0;
local ($::_g0 = do {do {no utf8; "â" ~~ Uni}}, $::_e0 = do {""}); ::ok defined($::_g0) == defined($::_e0) && $::_g0 eq $::_e0, 'do {no utf8; "â" ~~ Uni} # -> ""' or ::diag ::_struct_diff($::_g0, $::_e0); undef $::_g0; undef $::_e0;
#
# ## Bin
#
# СÑÑоки без Ñлага utf8.
#
::done_testing; }; subtest 'Bin' => sub {
local ($::_g0 = do {123 ~~ Bin}, $::_e0 = do {1}); ::ok defined($::_g0) == defined($::_e0) && $::_g0 eq $::_e0, '123 ~~ Bin # -> 1' or ::diag ::_struct_diff($::_g0, $::_e0); undef $::_g0; undef $::_e0;
local ($::_g0 = do {"z" ~~ Bin}, $::_e0 = do {1}); ::ok defined($::_g0) == defined($::_e0) && $::_g0 eq $::_e0, '"z" ~~ Bin # -> 1' or ::diag ::_struct_diff($::_g0, $::_e0); undef $::_g0; undef $::_e0;
local ($::_g0 = do {"â" ~~ Bin}, $::_e0 = do {""}); ::ok defined($::_g0) == defined($::_e0) && $::_g0 eq $::_e0, '"â" ~~ Bin # -> ""' or ::diag ::_struct_diff($::_g0, $::_e0); undef $::_g0; undef $::_e0;
local ($::_g0 = do {do {no utf8; "â" ~~ Bin }}, $::_e0 = do {1}); ::ok defined($::_g0) == defined($::_e0) && $::_g0 eq $::_e0, 'do {no utf8; "â" ~~ Bin } # -> 1' or ::diag ::_struct_diff($::_g0, $::_e0); undef $::_g0; undef $::_e0;
#
# ## StartsWith\[begin]
#
# СÑÑока наÑинаеÑÑÑ Ñ `begin`.
#
::done_testing; }; subtest 'StartsWith\[begin]' => sub {
local ($::_g0 = do {"Hi, world!" ~~ StartsWith["Hi,"];}, $::_e0 = do {1}); ::ok defined($::_g0) == defined($::_e0) && $::_g0 eq $::_e0, '"Hi, world!" ~~ StartsWith["Hi,"]; # -> 1' or ::diag ::_struct_diff($::_g0, $::_e0); undef $::_g0; undef $::_e0;
local ($::_g0 = do {"Hi world!" ~~ StartsWith["Hi,"];}, $::_e0 = do {""}); ::ok defined($::_g0) == defined($::_e0) && $::_g0 eq $::_e0, '"Hi world!" ~~ StartsWith["Hi,"]; # -> ""' or ::diag ::_struct_diff($::_g0, $::_e0); undef $::_g0; undef $::_e0;