# this doesnt make sense, but
# I need to prevent Moose from
# assiging to @ISA
-use base 'Moose::Autobox';
+use base 'UNIVERSAL';
use Moose;
with 'Moose::Autobox::Scalar';
*does = \&Moose::Object::does;
package ARRAY;
-use base 'Moose::Autobox';
+use base 'UNIVERSAL';
use Moose;
with 'Moose::Autobox::Array';
*does = \&Moose::Object::does;
package HASH;
-use base 'Moose::Autobox';
+use base 'UNIVERSAL';
use Moose;
with 'Moose::Autobox::Hash';
*does = \&Moose::Object::does;
package CODE;
-use base 'Moose::Autobox';
+use base 'UNIVERSAL';
use Moose;
with 'Moose::Autobox::Code';
use Moose::Autobox;
use autobox;
+ [ 1..5 ]->isa('ARRAY'); # true
+ [ a..z ]->does('Moose::Autobox::Array'); # true
+ [ 0..2 ]->does('Moose::Autobox::List'); # true
+
print "Squares: " . [ 1 .. 10 ]->map(sub { $_ * $_ })->join(', ');
+
+ print [ 1, 'number' ]->sprintf('%d is the loneliest %s');
=head1 DESCRIPTION
=over 4
-=item B<meta>
-
=item B<pop>
-=item B<push>
+=item B<push ($value)>
=item B<shift>
-=item B<unshift>
+=item B<unshift ($value)>
-=item B<delete>
+=item B<delete ($index)>
-=item B<sprintf>
+=item B<sprintf ($format_string)>
=back
-=head2 Moose::Autobox::Indexed implementation
+=head2 Indexed implementation
=over 4
-=item B<at>
+=item B<at ($index)>
-=item B<put>
+=item B<put ($index, $value)>
-=item B<exists>
+=item B<exists ($index)>
=item B<keys>
-=item B<kv>
-
=item B<values>
+=item B<kv>
+
=back
-=head2 Moose::Autobox::List implementation
+=head2 List implementation
=over 4
=item B<tail>
-=item B<join>
+=item B<join (?$seperator)>
=item B<length>
-=item B<map>
+=item B<map (\&block)>
-=item B<grep>
+=item B<grep (\&block)>
=item B<reverse>
-=item B<sort>
+=item B<sort (?\&block)>
+
+=back
+
+=over 4
+
+=item B<meta>
=back
use autobox;
my $adder = sub { $_[0] + $_[1] };
-
- $add_2 = $adder->curry(2);
+ my $add_2 = $adder->curry(2);
$add_2->(2); # returns 4
=over 4
-=item B<meta>
+=item B<curry (@values)>
+
+=item B<rcurry (@values)>
+
+=item B<conjoin (\&sub)>
-=item B<curry>
+=item B<disjoin (\&sub)>
-=item B<rcurry>
+=item B<compose (@subs)>
-=item B<conjoin>
+This will take a list of C<@subs> and compose them all into a single
+subroutine where the output of one sub will be the input of another.
-=item B<disjoin>
+=back
+
+=over 4
-=item B<compose>
+=item B<meta>
=back
use Moose::Autobox;
use autobox;
+
+ my $x;
+ $x->defined; # false
+
+ $x = 10;
+ $x->defined; # true
=head1 DESCRIPTION
=over 4
-=item B<meta>
-
=item B<defined>
=back
+=over 4
+
+=item B<meta>
+
+=back
+
=head1 BUGS
All complex software has bugs lurking in it, and this module is no
=over 4
-=item B<meta>
-
=item B<delete>
=back
-=head2 Moose::Autobox::Indexed implementation
+=head2 Indexed implementation
=over 4
=back
+=over 4
+
+=item B<meta>
+
+=back
+
=head1 BUGS
All complex software has bugs lurking in it, and this module is no
Moose::Autobox::Indexed - the Indexed role
-=head1 SYNOPOSIS
-
- use Moose::Autobox;
- use autobox;
-
=head1 DESCRIPTION
This is a role to describes an collection whose values can be
Moose::Autobox::Item - the Item role
-=head1 SYNOPOSIS
-
- use Moose::Autobox;
- use autobox;
-
=head1 DESCRIPTION
This is the root of our role hierarchy.
Moose::Autobox::List - the List role
-=head1 SYNOPOSIS
-
- use Moose::Autobox;
- use autobox;
-
=head1 DESCRIPTION
This is a role to describes a List interface. This is not
=over 4
-=item B<meta>
-
=item B<reduce>
=item B<zip>
=back
+=over 4
+
+=item B<meta>
+
+=back
+
=head1 REQUIRED METHODS
=over 4
Moose::Autobox::Number - the Number role
-=head1 SYNOPOSIS
-
- use Moose::Autobox;
- use autobox;
-
=head1 DESCRIPTION
This is a role to describes a Numeric value.
Moose::Autobox::Ref - the Ref role
-=head1 SYNOPOSIS
-
- use Moose::Autobox;
- use autobox;
-
=head1 DESCRIPTION
This is a role to describes a reference value.
Moose::Autobox::Scalar - the Scalar role
-=head1 SYNOPOSIS
-
- use Moose::Autobox;
- use autobox;
-
=head1 DESCRIPTION
This is a role to describes a Scalar value, which is defined
=over 4
-=item B<meta>
-
=item B<chomp>
=item B<chop>
=back
+=over 4
+
+=item B<meta>
+
+=back
+
=head1 BUGS
All complex software has bugs lurking in it, and this module is no
=head1 SYNOPOSIS
use Moose::Autobox;
- use autobox;
+ use autobox UNDEF => 'Moose::Autobox::Undef';
+
+ my $x;
+ $x->defined; # false
=head1 DESCRIPTION
=over 4
-=item B<meta>
-
=item B<defined>
=back
+=over 4
+
+=item B<meta>
+
+=back
+
=head1 BUGS
All complex software has bugs lurking in it, and this module is no
package Moose::Autobox::Value;
-use Moose::Role 'with', 'requires';
+use Moose::Role 'with';
our $VERSION = '0.01';