Submit Search
Upload
Functional perl
•
Download as ODP, PDF
•
0 likes
•
1,211 views
E
Errorific
Follow
Unpolished talk on functional concepts in perl.
Read less
Read more
Technology
Report
Share
Report
Share
1 of 59
Download now
Recommended
PHP 101
PHP 101
Muhammad Hijazi
Selected Bash shell tricks from Camp CDL breakout group
Selected Bash shell tricks from Camp CDL breakout group
John Kunze
Codigos
Codigos
Brian Joseff
Class 7a: Functions
Class 7a: Functions
Marc Gouw
PHP performance 101: so you need to use a database
PHP performance 101: so you need to use a database
Leon Fayer
Python programming : Standard Input and Output
Python programming : Standard Input and Output
Emertxe Information Technologies Pvt Ltd
Database performance 101
Database performance 101
Leon Fayer
Python : Dictionaries
Python : Dictionaries
Emertxe Information Technologies Pvt Ltd
Recommended
PHP 101
PHP 101
Muhammad Hijazi
Selected Bash shell tricks from Camp CDL breakout group
Selected Bash shell tricks from Camp CDL breakout group
John Kunze
Codigos
Codigos
Brian Joseff
Class 7a: Functions
Class 7a: Functions
Marc Gouw
PHP performance 101: so you need to use a database
PHP performance 101: so you need to use a database
Leon Fayer
Python programming : Standard Input and Output
Python programming : Standard Input and Output
Emertxe Information Technologies Pvt Ltd
Database performance 101
Database performance 101
Leon Fayer
Python : Dictionaries
Python : Dictionaries
Emertxe Information Technologies Pvt Ltd
Python легко и просто. Красиво решаем повседневные задачи
Python легко и просто. Красиво решаем повседневные задачи
Maxim Kulsha
Closure, Higher-order function in Swift
Closure, Higher-order function in Swift
SeongGyu Jo
Share test
Share test
Anton Stuk
Functional programming in Python
Functional programming in Python
Colin Su
Closures
Closures
SV.CO
Ramda, a functional JavaScript library
Ramda, a functional JavaScript library
Derek Willian Stavis
Beginning Haskell, Dive In, Its Not That Scary!
Beginning Haskell, Dive In, Its Not That Scary!
priort
Linguagem sql
Linguagem sql
Tic Eslc
Perl6 one-liners
Perl6 one-liners
Andrew Shitov
Ramda lets write declarative js
Ramda lets write declarative js
Pivorak MeetUp
The secrets of inverse brogramming
The secrets of inverse brogramming
Richie Cotton
Linux class 15 26 oct 2021
Linux class 15 26 oct 2021
Khawar Nehal khawar.nehal@atrc.net.pk
Functional Pattern Matching on Python
Functional Pattern Matching on Python
Daker Fernandes
Sharper tools with F#
Sharper tools with F#
Kevin Avignon
Menu func-sh(1)
Menu func-sh(1)
Ben Pope
Rakudo
Rakudo
awwaiid
Workshop on command line tools - day 1
Workshop on command line tools - day 1
Leandro Lima
Side by Side - Scala and Java Adaptations of Martin Fowler’s Javascript Refac...
Side by Side - Scala and Java Adaptations of Martin Fowler’s Javascript Refac...
Philip Schwarz
Workshop on command line tools - day 2
Workshop on command line tools - day 2
Leandro Lima
Road to Power Query NINJA – 1st STEP
Road to Power Query NINJA – 1st STEP
Takeshi Kagata
Crv book n ys
Crv book n ys
Jaksa Nikodijevic
Program and Project Management at the New World Trade Center
Program and Project Management at the New World Trade Center
novacsi
More Related Content
What's hot
Python легко и просто. Красиво решаем повседневные задачи
Python легко и просто. Красиво решаем повседневные задачи
Maxim Kulsha
Closure, Higher-order function in Swift
Closure, Higher-order function in Swift
SeongGyu Jo
Share test
Share test
Anton Stuk
Functional programming in Python
Functional programming in Python
Colin Su
Closures
Closures
SV.CO
Ramda, a functional JavaScript library
Ramda, a functional JavaScript library
Derek Willian Stavis
Beginning Haskell, Dive In, Its Not That Scary!
Beginning Haskell, Dive In, Its Not That Scary!
priort
Linguagem sql
Linguagem sql
Tic Eslc
Perl6 one-liners
Perl6 one-liners
Andrew Shitov
Ramda lets write declarative js
Ramda lets write declarative js
Pivorak MeetUp
The secrets of inverse brogramming
The secrets of inverse brogramming
Richie Cotton
Linux class 15 26 oct 2021
Linux class 15 26 oct 2021
Khawar Nehal khawar.nehal@atrc.net.pk
Functional Pattern Matching on Python
Functional Pattern Matching on Python
Daker Fernandes
Sharper tools with F#
Sharper tools with F#
Kevin Avignon
Menu func-sh(1)
Menu func-sh(1)
Ben Pope
Rakudo
Rakudo
awwaiid
Workshop on command line tools - day 1
Workshop on command line tools - day 1
Leandro Lima
Side by Side - Scala and Java Adaptations of Martin Fowler’s Javascript Refac...
Side by Side - Scala and Java Adaptations of Martin Fowler’s Javascript Refac...
Philip Schwarz
Workshop on command line tools - day 2
Workshop on command line tools - day 2
Leandro Lima
Road to Power Query NINJA – 1st STEP
Road to Power Query NINJA – 1st STEP
Takeshi Kagata
What's hot
(20)
Python легко и просто. Красиво решаем повседневные задачи
Python легко и просто. Красиво решаем повседневные задачи
Closure, Higher-order function in Swift
Closure, Higher-order function in Swift
Share test
Share test
Functional programming in Python
Functional programming in Python
Closures
Closures
Ramda, a functional JavaScript library
Ramda, a functional JavaScript library
Beginning Haskell, Dive In, Its Not That Scary!
Beginning Haskell, Dive In, Its Not That Scary!
Linguagem sql
Linguagem sql
Perl6 one-liners
Perl6 one-liners
Ramda lets write declarative js
Ramda lets write declarative js
The secrets of inverse brogramming
The secrets of inverse brogramming
Linux class 15 26 oct 2021
Linux class 15 26 oct 2021
Functional Pattern Matching on Python
Functional Pattern Matching on Python
Sharper tools with F#
Sharper tools with F#
Menu func-sh(1)
Menu func-sh(1)
Rakudo
Rakudo
Workshop on command line tools - day 1
Workshop on command line tools - day 1
Side by Side - Scala and Java Adaptations of Martin Fowler’s Javascript Refac...
Side by Side - Scala and Java Adaptations of Martin Fowler’s Javascript Refac...
Workshop on command line tools - day 2
Workshop on command line tools - day 2
Road to Power Query NINJA – 1st STEP
Road to Power Query NINJA – 1st STEP
Viewers also liked
Crv book n ys
Crv book n ys
Jaksa Nikodijevic
Program and Project Management at the New World Trade Center
Program and Project Management at the New World Trade Center
novacsi
How to Build a Tower
How to Build a Tower
alaska150
Functional Planning of a Building
Functional Planning of a Building
Mr. Ramesh Nayaka
اسس تصميم المباني الادارية Office building design & The Edge Office a Greenes...
اسس تصميم المباني الادارية Office building design & The Edge Office a Greenes...
Ahmed SHoukry ELhfnawy
مباني ادارية
مباني ادارية
freemadoo
State of Education in the Philippines 2012
State of Education in the Philippines 2012
Arangkada Philippines
Burj khalifa
Burj khalifa
Safa Aboelssaad
Viewers also liked
(8)
Crv book n ys
Crv book n ys
Program and Project Management at the New World Trade Center
Program and Project Management at the New World Trade Center
How to Build a Tower
How to Build a Tower
Functional Planning of a Building
Functional Planning of a Building
اسس تصميم المباني الادارية Office building design & The Edge Office a Greenes...
اسس تصميم المباني الادارية Office building design & The Edge Office a Greenes...
مباني ادارية
مباني ادارية
State of Education in the Philippines 2012
State of Education in the Philippines 2012
Burj khalifa
Burj khalifa
Similar to Functional perl
Functional Pearls 4 (YAPC::EU::2009 remix)
Functional Pearls 4 (YAPC::EU::2009 remix)
osfameron
Simple Ways To Be A Better Programmer (OSCON 2007)
Simple Ways To Be A Better Programmer (OSCON 2007)
Michael Schwern
Perl6 a whistle stop tour
Perl6 a whistle stop tour
Simon Proctor
Perl6 a whistle stop tour
Perl6 a whistle stop tour
Simon Proctor
perl usage at database applications
perl usage at database applications
Joe Jiang
From Javascript To Haskell
From Javascript To Haskell
ujihisa
Is Haskell an acceptable Perl?
Is Haskell an acceptable Perl?
osfameron
Writing Maintainable Perl
Writing Maintainable Perl
tinypigdotcom
Good Evils In Perl (Yapc Asia)
Good Evils In Perl (Yapc Asia)
Kang-min Liu
Good Evils In Perl
Good Evils In Perl
Kang-min Liu
How to write code you won't hate tomorrow
How to write code you won't hate tomorrow
Pete McFarlane
Perl6 Regexen: Reduce the line noise in your code.
Perl6 Regexen: Reduce the line noise in your code.
Workhorse Computing
Why async and functional programming in PHP7 suck and how to get overr it?
Why async and functional programming in PHP7 suck and how to get overr it?
Lucas Witold Adamus
Mips1
Mips1
Stefano Salvatori
FP in scalaで鍛える関数型脳
FP in scalaで鍛える関数型脳
Yuri Inoue
Top 10 php classic traps
Top 10 php classic traps
Damien Seguy
Internationalizing CakePHP Applications
Internationalizing CakePHP Applications
Pierre MARTIN
PHPCon 2016: PHP7 by Witek Adamus / XSolve
PHPCon 2016: PHP7 by Witek Adamus / XSolve
XSolve
Refactoring to Macros with Clojure
Refactoring to Macros with Clojure
Dmitry Buzdin
Neatly Hashing a Tree: FP tree-fold in Perl5 & Perl6
Neatly Hashing a Tree: FP tree-fold in Perl5 & Perl6
Workhorse Computing
Similar to Functional perl
(20)
Functional Pearls 4 (YAPC::EU::2009 remix)
Functional Pearls 4 (YAPC::EU::2009 remix)
Simple Ways To Be A Better Programmer (OSCON 2007)
Simple Ways To Be A Better Programmer (OSCON 2007)
Perl6 a whistle stop tour
Perl6 a whistle stop tour
Perl6 a whistle stop tour
Perl6 a whistle stop tour
perl usage at database applications
perl usage at database applications
From Javascript To Haskell
From Javascript To Haskell
Is Haskell an acceptable Perl?
Is Haskell an acceptable Perl?
Writing Maintainable Perl
Writing Maintainable Perl
Good Evils In Perl (Yapc Asia)
Good Evils In Perl (Yapc Asia)
Good Evils In Perl
Good Evils In Perl
How to write code you won't hate tomorrow
How to write code you won't hate tomorrow
Perl6 Regexen: Reduce the line noise in your code.
Perl6 Regexen: Reduce the line noise in your code.
Why async and functional programming in PHP7 suck and how to get overr it?
Why async and functional programming in PHP7 suck and how to get overr it?
Mips1
Mips1
FP in scalaで鍛える関数型脳
FP in scalaで鍛える関数型脳
Top 10 php classic traps
Top 10 php classic traps
Internationalizing CakePHP Applications
Internationalizing CakePHP Applications
PHPCon 2016: PHP7 by Witek Adamus / XSolve
PHPCon 2016: PHP7 by Witek Adamus / XSolve
Refactoring to Macros with Clojure
Refactoring to Macros with Clojure
Neatly Hashing a Tree: FP tree-fold in Perl5 & Perl6
Neatly Hashing a Tree: FP tree-fold in Perl5 & Perl6
Recently uploaded
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
MounikaPolabathina
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
Kalema Edgar
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
LoriGlavin3
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
BookNet Canada
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
2toLead Limited
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
BookNet Canada
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
LoriGlavin3
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
Curtis Poe
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
Rizwan Syed
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
Fwdays
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
Florian Wilhelm
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
Hervé Boutemy
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
Dilum Bandara
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptx
BkGupta21
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
Dubai Multi Commodity Centre
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Precisely
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
DianaGray10
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
Commit University
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
ScyllaDB
Recently uploaded
(20)
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptx
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
Functional perl
1.
Functional Programming
Perl Christopher Mckay error@errorific.com
2.
What Am I
3.
What's this talk
all about?
4.
History
5.
How
6.
Why not?
7.
But I don't
use/appreciate/like perl?
8.
Functional Programming is
Easy
9.
So easy sysadmins
do it
10.
In the beginning...
11.
12.
Wrote Pearl Perl
13.
People wanted a
sort function Larry was generous
14.
sort F(a, a), [a]
--------> [a]
15.
@sorted_list =
sort {$_[0] <=> $_[1]} @list
16.
@sorted_list =
sort {$a <=> $b } @list
17.
@sorted_list
= sort {$a <=> $b} @list
18.
sort
String sorting sort {$a cmp $b} Also string sorting sort {$a <=> $b} Sort numerically sort &comparator Sort by function named comparator
19.
sort {
@a = split ///, $a; @b = split ///, $b; ($a[2] <=> $b[2]) || ($a[1] <=> $b[1]) || ($a[0] <=> $b[0]) || 0; } @list_of_dmy_dates
20.
1988 - Perl
2.0 1989 - Perl 3.0 1991 - Perl 4.0
21.
grep F(a, a), [a]
--------> [a]
22.
map F(a), [a] -------->
[a]
23.
1994 – Perl
5.0
24.
memoize F(a) → b
--------------> F(a) → b
25.
List::Util
reduce F(a, b) → b, [a] --------------> b
26.
List::MoreUtils any, all, none,
notall, true, false, firstidx, first_index, lastidx, part, mesh, last_index, insert_after, zip, uniq, apply, indexes, after, after_incl, before, before_incl, firstval, first_value, lastval, last_value, pairwise, distinct, minmax
27.
28.
So Perl evolved
a functional theme
29.
So how do
I make functional stuff in perl instead of just using it?
30.
Lexical scoping
31.
First class functions
32.
That's about it. Your
language does that too right?
33.
So lets write
a function that rolls a die
34.
my $dx =
sub { my ($sides) = @_; return (rand() * $sides) + 1; } my $roll = $dx->(6);
35.
I don't like
rolling 1's though so...
36.
my $cheat =
sub { my ($roll) = @_; if ($roll < 2) { return 2; } else { return $roll; } }
37.
I don't want
to get caught turning the die over though so ...
38.
my $inconspicuous_dx =
sub { my ($sides) = @_; return $cheat->($dx->($sides)); }
39.
my $compose =
sub { my ($fa, $fb) = @_; return sub { return $fa->($fb->(@_)); } }
40.
my $inconspicuous_dx =
$compose->($cheat, $dx); my $better_roll = $inconspicuous_dx->(6);
41.
Monads in Perl Masahiro
Honma (hiratara) YAPC::Asia 2011 Slides are in english Data::Monad
42.
All I ever
need is d6!
43.
my $d6 =
sub { return $inconspicuous_dx->(6); }; my $roll_a_6 = $d6->();
44.
Too lazy to
roll 20d6
45.
my $dice_tower_maker =
sub { my ($die) = @_; return sub { my ($rolls) = @_; return map { $die->() } (1 .. $rolls); } }
46.
my $dice_tower =
$dice_tower_generator->($d6); say join(', ', $dice_tower->(20));
47.
use List::Util; say sum
$dice_tower->(20);
48.
use List::Util; say reduce
{$a + $b} $dice_tower->(20);
49.
So why not
use this stuff for everything?
50.
The compilers not
out to help you
51.
Declaring functions gets
obtuse after awhile
52.
Purity isn't an
option, everything changes
53.
The community loves
objects
54.
If it was
simple in a functional language it probably takes some hacking to make it work in perl
55.
And the language
isn't extensible, yet
56.
Good things are
to come
57.
Perl 6
58.
Static typing
Better syntax Blocks and closures List comprehension Automatic parallelisation Lots more
59.
Thanks Questions?
Download now