Moose:...::Code(3pm)
π Moose:...::Code(3pm) π
okay so bestie, you're reading a page from the User Contributed Perl Documentation collection, and the star of the show is Moose::...::Code. pull up a chair, grab a boba, we're doing this π§β¨
πΈ NAME πΈ
Moose::Autobox::Code β it's the Code role, periodt π
β¨ VERSION β¨
version 0.16 β she's vintage, she's iconic, she's been here π
π¦ SYNOPSIS π¦
here's the vibe, copy-paste-able and everything:
use Moose::Autobox;
my $adder = sub { $_[0] + $_[1] };
my $add_2 = $adder->curry(2);
$add_2->(2); # returns 4
# create a recursive subroutine
# using the Y combinator
*factorial = sub {
my $f = shift;
sub {
my $n = shift;
return 1 if $n < 2;
return $n * $f->($n - 1);
}
}->y;
factorial(10) # returns 3628800
not the Y combinator making factorial(10) pop off with 3628800 ππ₯ math ate and left no crumbs fr fr
π DESCRIPTION π
so basically? this is a role β and what it does is describe operations on the Code type. that's the whole assignment. she's a role about Code things. slay π
π METHODS π
here's the full roster, no skips, no cuts, we love a complete list:
"curry (@values)""rcurry (@values)""conjoin (\&sub)""disjoin (\&sub)""compose (@subs)"β okay so THIS one comes with lore: it takes a list of@subsand composes them all into a single subroutine, where the output of one sub becomes the input of another. it's giving assembly line but make it fancy πβ¨"y"β this implements the Y combinator. yes, that Y combinator. main character energy fr π«Ά"u"β and this one implements the U combinator. the sequel nobody asked for but everybody needed π"meta"β that's it. that's the method. she said "meta" and left π
ngl bestie, the source page keeps it cute and mysterious for a few of these β the names are all we get, so I'm not gonna sit here and make stuff up about them. iykyk π
β SEE ALSO β
go touch some grass, but like, scholarly grass:
- <http://en.wikipedia.org/wiki/Fixed_point_combinator>
- <http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/20469>
π SUPPORT π
got bugs? first of all, relatable. second of all, here's where they go:
- Bugs may be submitted through the RT bug tracker <https://rt.cpan.org/Public/Dist/Display.html?Name=Moose-Autobox> (or bug-Moose-Autobox@rt.cpan.org <mailto:bug-Moose-Autobox@rt.cpan.org>).
- There's also a mailing list for users of this distribution, at <http://lists.perl.org/list/moose.html>.
- And there's an irc channel for users of this distribution, at
"#moose"on"irc.perl.org"<irc://irc.perl.org/#moose>.
come hang, we don't bite π«Ά
πΈ AUTHOR πΈ
Stevan Little <stevan.little@iinteractive.com> β thank you for your service, king π
π COPYRIGHT AND LICENSE π
This software is copyright (c) 2006 by Infinity Interactive, Inc.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
and that's the whole page, bestie!! this one was rendered underperl v5.34.0, dated2022-06-15, and the page itself isMoose:...::Code(3pm)β same energy, same facts, just with way better vibes πβ¨ mwah, go write some curried subs, ily π«Άπ
π¦ where this page comes from
- debian bookworm: libmoose-autobox-perl 0.16-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libmoose-autobox-perl 0.16-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libmoose-autobox-perl 0.16-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libmoose-autobox-perl 0.16-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libmoose-autobox-perl 0.16-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms