Aion

 view release on metacpan or  search on metacpan

Changes  view on Meta::CPAN

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]

t/aion.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 - постмодернистская объектная система для 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;



( run in 1.601 second using v1.01-cache-2.11-cpan-8379b9b8ec2 )