<commit_before>package Specio;

use strict;
use warnings;

use v5.10;

1;

# ABSTRACT: Type constraints and coercions for Perl

__END__

=head1 SYNOPSIS

  package MyApp::Type::Library;

  use Specio::Declare;
  use Specio::Library::Builtins;

  declare(
      'PositiveInt',
      parent => t('Int'),
      inline => sub {
          $_[0]->parent()->inline_check( $_[1] ) . ' && ( ' . $_[1] . ' > 0';
      },
  );

  # or ...

  declare(
      'PositiveInt',
      parent => t('Int'),
      where  => sub { $_[0] > 0 },
  );

  declare(
      'ArrayRefOfPositiveInt',
      parent => t(
          'ArrayRef',
          of => t('PositiveInt'),
      ),
  );

  coerce(
      'ArrayRefOfPositiveInt',
      from  => t('PositiveInt'),
      using => sub { [ $_[0] ] },
  );

  any_can_type(
      'Duck',
      methods => [ 'duck_walk', 'quack' ],
  );

  object_isa_type('MyApp::Person');

=head1 DESCRIPTION

B<WARNING: This thing is very alpha.><commit_msg>Tidy and indent synopsis code in Specio.pm<commit_after>package Specio;

use strict;
use warnings;

use v5.10;

1;

# ABSTRACT: Type constraints and coercions for Perl

__END__

=head1 SYNOPSIS

    package MyApp::Type::Library;

    use Specio::Declare;
    use Specio::Library::Builtins;

    declare(
        'PositiveInt',
        parent => t('Int'),
        inline => sub {
            $_[0]->parent()->inline_check( $_[1] )
                . ' && ( '
                . $_[1] . ' > 0';
        },
    );

    # or ...

    declare(
        'PositiveInt',
        parent => t('Int'),
        where  => sub { $_[0] > 0 },
    );

    declare(
        'ArrayRefOfPositiveInt',
        parent => t(
            'ArrayRef',
            of => t('PositiveInt'),
        ),
    );

    coerce(
        'ArrayRefOfPositiveInt',
        from  => t('PositiveInt'),
        using => sub { [ $_[0] ] },
    );

    any_can_type(
        'Duck',
        methods => [ 'duck_walk', 'quack' ],
    );

    object_isa_type('MyApp::Person');

=head1 DESCRIPTION

B<WARNING: This thing is very alpha.>
{'fraction_non_alphanumeric': 0.16674816625916872, 'fraction_numerical': 0.012713936430317848, 'mean_word_length': 1.9912280701754386, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 31, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1621534', 'n_tokens_mistral': 741, 'n_tokens_neox': 692, 'n_words': 149}