Skip to content

tobyink/list-objects-types

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NAME

List::Objects::Types - Type::Tiny-based types for List::Objects::WithUtils

SYNOPSIS

package Foo;

use List::Objects::Types -all;
use List::Objects::WithUtils;
use Moo;

has my_array => (
  is  => 'ro',
  isa => ArrayObj,
  default => sub { array }
);

has my_hash => (
  is  => 'ro',
  isa => HashObj,
  default => sub { hash }
);

has static_array => (
  is  => 'ro',
  isa => ImmutableArray,
  default => sub { immarray(qw/ foo bar /) }
);

DESCRIPTION

A small set of Type::Tiny-based types & coercions.

Also see MoopsX::ListObjects, which provides Moops class-building sugar with List::Objects::WithUtils integration.

ArrayObj

An object that consumes List::Objects::WithUtils::Role::Array.

Can be coerced from a plain ARRAY; a shallow copy is performed.

HashObj

An object that consumes List::Objects::WithUtils::Role::Hash.

Can be coerced from a plain HASH; a shallow copy is performed.

ImmutableArray

An object that isa List::Objects::WithUtils::Array::Immutable.

Can be coerced from a plain ARRAY or an "ArrayObj"; a shallow copy is performed.

TypedArray

An object that isa List::Objects::WithUtils::Array::Typed.

Not coercible.

AUTHOR

Jon Portnoy avenj@cobaltirc.org

About

List::Objects::Types

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Perl 100.0%