Revision history for Perl extension Moose::Autobox
0.08
+ - add flatten method to Array and Hash
- upped the dependency on autobox from 1.22 to 2.23
at the suggestion of chocolateboy
- might as well up the Moose dependency too.
$array->keys->map(sub { [ $_, $array->[$_] ] });
}
+sub flatten {
+ @{$_[0]}
+}
+
## Junctions
sub all {
=item B<slice (@indices)>
+=item B<flatten>
+
=back
=head2 Indexed implementation
return { map { $_ => $hash->{$_} } @$keys };
}
+sub flatten {
+ return %{$_[0]}
+}
+
# ::Indexed implementation
sub at {
Slices a hash but returns the keys and values as a new hashref.
+=item B<flatten>
+
=back
=head2 Indexed implementation
This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself.
-=cut
\ No newline at end of file
+=cut