The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

TLC::Example - type constraint library

TYPES

This type constraint library is even more basic that Type::Tiny. Exported types may be combined using Foo | Bar but parameterized type constraints like Foo[Bar] are not supported.

Any

Based on Any in Types::Standard.

The Any constant returns a blessed type constraint object. is_Any($value) checks a value against the type and returns a boolean. assert_Any($value) checks a value against the type and throws an error.

To import all of these functions:

  use TLC::Example qw( :Any );

Array

Based on ArrayRef in Types::Standard.

The Array constant returns a blessed type constraint object. is_Array($value) checks a value against the type and returns a boolean. assert_Array($value) checks a value against the type and throws an error.

To import all of these functions:

  use TLC::Example qw( :Array );

Directory

Based on Dir in Types::Path::Tiny.

The Directory constant returns a blessed type constraint object. is_Directory($value) checks a value against the type and returns a boolean. assert_Directory($value) checks a value against the type and throws an error.

To import all of these functions:

  use TLC::Example qw( :Directory );

File

Based on File in Types::Path::Tiny.

The File constant returns a blessed type constraint object. is_File($value) checks a value against the type and returns a boolean. assert_File($value) checks a value against the type and throws an error.

To import all of these functions:

  use TLC::Example qw( :File );

Hash

Based on HashRef in Types::Standard.

The Hash constant returns a blessed type constraint object. is_Hash($value) checks a value against the type and returns a boolean. assert_Hash($value) checks a value against the type and throws an error.

To import all of these functions:

  use TLC::Example qw( :Hash );

Integer

Based on Int in Types::Standard.

The Integer constant returns a blessed type constraint object. is_Integer($value) checks a value against the type and returns a boolean. assert_Integer($value) checks a value against the type and throws an error.

To import all of these functions:

  use TLC::Example qw( :Integer );

NonEmptyString

Based on NonEmptyStr in Types::Common::String.

The NonEmptyString constant returns a blessed type constraint object. is_NonEmptyString($value) checks a value against the type and returns a boolean. assert_NonEmptyString($value) checks a value against the type and throws an error.

To import all of these functions:

  use TLC::Example qw( :NonEmptyString );

Null

Based on Undef in Types::Standard.

The Null constant returns a blessed type constraint object. is_Null($value) checks a value against the type and returns a boolean. assert_Null($value) checks a value against the type and throws an error.

To import all of these functions:

  use TLC::Example qw( :Null );

Number

Based on Num in Types::Standard.

The Number constant returns a blessed type constraint object. is_Number($value) checks a value against the type and returns a boolean. assert_Number($value) checks a value against the type and throws an error.

To import all of these functions:

  use TLC::Example qw( :Number );

Object

Based on Object in Types::Standard.

The Object constant returns a blessed type constraint object. is_Object($value) checks a value against the type and returns a boolean. assert_Object($value) checks a value against the type and throws an error.

To import all of these functions:

  use TLC::Example qw( :Object );

Path

Based on Path in Types::Path::Tiny.

The Path constant returns a blessed type constraint object. is_Path($value) checks a value against the type and returns a boolean. assert_Path($value) checks a value against the type and throws an error.

To import all of these functions:

  use TLC::Example qw( :Path );

String

Based on Str in Types::Standard.

The String constant returns a blessed type constraint object. is_String($value) checks a value against the type and returns a boolean. assert_String($value) checks a value against the type and throws an error.

To import all of these functions:

  use TLC::Example qw( :String );