SlideShare une entreprise Scribd logo
1  sur  103
Functional pe(a)rls ,[object Object],[object Object],[object Object],[object Object]
A sequence ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
A sequence ,[object Object],[object Object],[object Object]
A sequence ,[object Object]
A sequence ,[object Object]
A sequence ,[object Object]
A sequence ,[object Object]
A sequence ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
A sequence ,[object Object],[object Object]
A sequence ,[object Object]
A sequence ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
A sequence ,[object Object]
A sequence ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
A sequence cycle [2.5, 2, 2];
A sequence 10, cycle [2.5, 2, 2];
A sequence   mult,  10, cycle [2.5, 2, 2];
(curry)‏ ,[object Object],[object Object],[object Object]
(curry)‏ ,[object Object],[object Object]
(curry)‏ ,[object Object],[object Object],[object Object]
(curry)‏ ,[object Object],[object Object]
(curry)‏ ,[object Object],[object Object]
A sequence   mult ,  10, cycle [2.5, 2, 2];
A sequence scan    mult,  10, cycle [2.5, 2, 2];
(Scanning)‏ scan  add,  1, [2, 3, 4]; # [1, 3, 6, 10]
A sequence scan    mult,  10, cycle  [2.5, 2, 2];
A sequence take 12 =>  scan    mult,  10, cycle [2.5, 2, 2];
A sequence say for  take 12 =>  scan    mult,  10, cycle [2.5, 2, 2];
A sequence ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
How? ,[object Object],[object Object],[object Object]
How? ,[object Object],[object Object]
How? ,[object Object],[object Object],[object Object]
How? ,[object Object],[object Object],[object Object],[object Object]
Devel::Declare ,[object Object],[object Object],[object Object]
Devel::Declare ,[object Object],[object Object]
Devel::Declare ,[object Object],[object Object],[object Object],[object Object],[object Object]
Devel::Declare ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Devel::Declare ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Some light relief
Some light relief Monads
Monads ,[object Object],[object Object]
Monads ,[object Object],[object Object],[object Object]
Monads ,[object Object],[object Object],[object Object],[object Object]
Monad tutorials
Monad tutorials
Monad tutorials
Monad tutorials
Monad tutorials Step 1: Write Monad Tutorial
Monad tutorials Step 2: ???
Monad tutorials Step 3: Profit!
Monads ,[object Object]
Monads ,[object Object],[object Object]
Monads ,[object Object],[object Object]
Sequencing my $x = 1; my $y = 2; my $z = $x * $y; say “$x * $y = $z”;
Sequencing my $x = 1; my $y = 2; my $z = $x * $y; say “$x * $y = $z”;
Sequencing my $x = 1; my $y = 2; my $z = $x * $y; say “$x * $y = $z”;
Sequencing my @seq = sub { my $x = 1 }, sub { my $y = 2 }, sub { my $z = $x * $y }, sub { say "$x * $y = $z"  };
Sequencing my @seq = sub { my $x = 1 }, sub { my $y = 2 }, sub { my $z = $x * $y }, sub { say "$x * $y = $z"  }; # Global symbol "$x" requires explicit package name at  ...
Nesting my $x = 1; my $y = 2; my $z = $x * $y; say “$x * $y = $z”;
Nesting sub { my $x = 1; sub { my $y = 2; sub { my $z = $x * $y; sub { say "$x * $y = $z"; }->() }->() }->() }->();
Monads made pretty ,[object Object],[object Object]
Monads made pretty ,[object Object],[object Object],[object Object],[object Object]
Monads made pretty ,[object Object],[object Object]
Monads made pretty ,[object Object],[object Object],[object Object],[object Object]
Optree munging ,[object Object],[object Object]
Optree munging ,[object Object],[object Object],KABOOM
Source deparsing ,[object Object]
Source deparsing ,[object Object],[object Object],[object Object]
Source deparsing ,[object Object],[object Object],[object Object],[object Object]
Devel::Declare ,[object Object],[object Object]
Devel::Declare ,[object Object],[object Object]
Devel::Declare ,[object Object],[object Object]
Devel::Declare ,[object Object],[object Object],[object Object],[object Object],[object Object]
Devel::Declare ,[object Object],[object Object]
Devel::Declare ,[object Object],[object Object]
Devel::Declare ,[object Object],[object Object]
Devel::Declare ,[object Object],[object Object]
So... ,[object Object],[object Object]
So... ,[object Object],[object Object]
So... ,[object Object],[object Object]
So... ,[object Object],[object Object],[object Object]
What else can monads  do  ? ,[object Object],[object Object]
What else can monads  do  ? ,[object Object],[object Object]
What else can monads  do  ? ,[object Object],[object Object]
What else can monads  do  ? ,[object Object],[object Object],[object Object]
Maybe ,[object Object],[object Object]
Maybe ,[object Object],[object Object],[object Object]
Maybe ,[object Object],[object Object],[object Object],[object Object]
Maybe $FH = open($file)‏ $line = <$FH> $val = lookup ( $line )‏ say “Found $val”
Maybe $FH = open($file)‏ $line = <$FH> $val = lookup ( $line )‏ say “Found $val”
Sequence
Maybe ? ? ?
Multiple (List)‏
List $x = [1..10] $y = [1..10] guard $x+$y == 10 say “$x+$y=10”
List ,[object Object],[object Object],[object Object]
List ,[object Object],[object Object],[object Object],[object Object],[object Object]
List ,[object Object],[object Object],[object Object],[object Object]
List comprehension ,[object Object],[object Object]
List ,[object Object],[object Object]
List ,[object Object],[object Object],[object Object]
Perl++ ,[object Object],[object Object],[object Object]
What else can I do with monads? ,[object Object],[object Object],[object Object],[object Object]
Wants monads now! ,[object Object],[object Object]
Thanks! ,[object Object]

Contenu connexe

Tendances

Perl.Hacks.On.Vim
Perl.Hacks.On.VimPerl.Hacks.On.Vim
Perl.Hacks.On.Vim
Lin Yo-An
 
Good Evils In Perl (Yapc Asia)
Good Evils In Perl (Yapc Asia)Good Evils In Perl (Yapc Asia)
Good Evils In Perl (Yapc Asia)
Kang-min Liu
 

Tendances (20)

Descobrindo a linguagem Perl
Descobrindo a linguagem PerlDescobrindo a linguagem Perl
Descobrindo a linguagem Perl
 
The Perl6 Type System
The Perl6 Type SystemThe Perl6 Type System
The Perl6 Type System
 
PHP and MySQL
PHP and MySQLPHP and MySQL
PHP and MySQL
 
Perl 6 in Context
Perl 6 in ContextPerl 6 in Context
Perl 6 in Context
 
RxSwift 시작하기
RxSwift 시작하기RxSwift 시작하기
RxSwift 시작하기
 
Introdução ao Perl 6
Introdução ao Perl 6Introdução ao Perl 6
Introdução ao Perl 6
 
Programming Lisp Clojure - 2장 : 클로저 둘러보기
Programming Lisp Clojure - 2장 : 클로저 둘러보기Programming Lisp Clojure - 2장 : 클로저 둘러보기
Programming Lisp Clojure - 2장 : 클로저 둘러보기
 
Perl 6 by example
Perl 6 by examplePerl 6 by example
Perl 6 by example
 
An Elephant of a Different Colour: Hack
An Elephant of a Different Colour: HackAn Elephant of a Different Colour: Hack
An Elephant of a Different Colour: Hack
 
Perl.Hacks.On.Vim
Perl.Hacks.On.VimPerl.Hacks.On.Vim
Perl.Hacks.On.Vim
 
Good Evils In Perl (Yapc Asia)
Good Evils In Perl (Yapc Asia)Good Evils In Perl (Yapc Asia)
Good Evils In Perl (Yapc Asia)
 
Perl6 a whistle stop tour
Perl6 a whistle stop tourPerl6 a whistle stop tour
Perl6 a whistle stop tour
 
Perl6 a whistle stop tour
Perl6 a whistle stop tourPerl6 a whistle stop tour
Perl6 a whistle stop tour
 
Can't Miss Features of PHP 5.3 and 5.4
Can't Miss Features of PHP 5.3 and 5.4Can't Miss Features of PHP 5.3 and 5.4
Can't Miss Features of PHP 5.3 and 5.4
 
Zend Certification Preparation Tutorial
Zend Certification Preparation TutorialZend Certification Preparation Tutorial
Zend Certification Preparation Tutorial
 
groovy & grails - lecture 3
groovy & grails - lecture 3groovy & grails - lecture 3
groovy & grails - lecture 3
 
Static Optimization of PHP bytecode (PHPSC 2017)
Static Optimization of PHP bytecode (PHPSC 2017)Static Optimization of PHP bytecode (PHPSC 2017)
Static Optimization of PHP bytecode (PHPSC 2017)
 
"How was it to switch from beautiful Perl to horrible JavaScript", Viktor Tur...
"How was it to switch from beautiful Perl to horrible JavaScript", Viktor Tur..."How was it to switch from beautiful Perl to horrible JavaScript", Viktor Tur...
"How was it to switch from beautiful Perl to horrible JavaScript", Viktor Tur...
 
Swift 함수 커링 사용하기
Swift 함수 커링 사용하기Swift 함수 커링 사용하기
Swift 함수 커링 사용하기
 
Mirror, mirror on the wall: Building a new PHP reflection library (DPC 2016)
Mirror, mirror on the wall: Building a new PHP reflection library (DPC 2016)Mirror, mirror on the wall: Building a new PHP reflection library (DPC 2016)
Mirror, mirror on the wall: Building a new PHP reflection library (DPC 2016)
 

Similaire à Functional Pe(a)rls version 2

Designing Opeation Oriented Web Applications / YAPC::Asia Tokyo 2011
Designing Opeation Oriented Web Applications / YAPC::Asia Tokyo 2011Designing Opeation Oriented Web Applications / YAPC::Asia Tokyo 2011
Designing Opeation Oriented Web Applications / YAPC::Asia Tokyo 2011
Masahiro Nagano
 
R57php 1231677414471772-2
R57php 1231677414471772-2R57php 1231677414471772-2
R57php 1231677414471772-2
ady36
 
Good Evils In Perl
Good Evils In PerlGood Evils In Perl
Good Evils In Perl
Kang-min Liu
 
PERL for QA - Important Commands and applications
PERL for QA - Important Commands and applicationsPERL for QA - Important Commands and applications
PERL for QA - Important Commands and applications
Sunil Kumar Gunasekaran
 

Similaire à Functional Pe(a)rls version 2 (20)

循環参照のはなし
循環参照のはなし循環参照のはなし
循環参照のはなし
 
distill
distilldistill
distill
 
Creating a compiler in Perl 6
Creating a compiler in Perl 6Creating a compiler in Perl 6
Creating a compiler in Perl 6
 
Designing Opeation Oriented Web Applications / YAPC::Asia Tokyo 2011
Designing Opeation Oriented Web Applications / YAPC::Asia Tokyo 2011Designing Opeation Oriented Web Applications / YAPC::Asia Tokyo 2011
Designing Opeation Oriented Web Applications / YAPC::Asia Tokyo 2011
 
Mips1
Mips1Mips1
Mips1
 
PHP in 2018 - Q4 - AFUP Limoges
PHP in 2018 - Q4 - AFUP LimogesPHP in 2018 - Q4 - AFUP Limoges
PHP in 2018 - Q4 - AFUP Limoges
 
R57php 1231677414471772-2
R57php 1231677414471772-2R57php 1231677414471772-2
R57php 1231677414471772-2
 
Ethiopian multiplication in Perl6
Ethiopian multiplication in Perl6Ethiopian multiplication in Perl6
Ethiopian multiplication in Perl6
 
Good Evils In Perl
Good Evils In PerlGood Evils In Perl
Good Evils In Perl
 
Bag of tricks
Bag of tricksBag of tricks
Bag of tricks
 
Document Classification In PHP
Document Classification In PHPDocument Classification In PHP
Document Classification In PHP
 
PERL for QA - Important Commands and applications
PERL for QA - Important Commands and applicationsPERL for QA - Important Commands and applications
PERL for QA - Important Commands and applications
 
Bouncingballs sh
Bouncingballs shBouncingballs sh
Bouncingballs sh
 
The Art of Transduction
The Art of TransductionThe Art of Transduction
The Art of Transduction
 
Functional Pearls 4 (YAPC::EU::2009 remix)
Functional Pearls 4 (YAPC::EU::2009 remix)Functional Pearls 4 (YAPC::EU::2009 remix)
Functional Pearls 4 (YAPC::EU::2009 remix)
 
Method::Signatures
Method::SignaturesMethod::Signatures
Method::Signatures
 
Modern Perl
Modern PerlModern Perl
Modern Perl
 
Java
JavaJava
Java
 
java-introduction.pdf
java-introduction.pdfjava-introduction.pdf
java-introduction.pdf
 
R57.Php
R57.PhpR57.Php
R57.Php
 

Plus de osfameron

Plus de osfameron (11)

Writing a Tile-Matching Game - FP Style
Writing a Tile-Matching Game - FP StyleWriting a Tile-Matching Game - FP Style
Writing a Tile-Matching Game - FP Style
 
Data Structures for Text Editors
Data Structures for Text EditorsData Structures for Text Editors
Data Structures for Text Editors
 
Rewriting the Apocalypse
Rewriting the ApocalypseRewriting the Apocalypse
Rewriting the Apocalypse
 
Global Civic Hacking 101 (lightning talk)
Global Civic Hacking 101 (lightning talk)Global Civic Hacking 101 (lightning talk)
Global Civic Hacking 101 (lightning talk)
 
Adventures in civic hacking
Adventures in civic hackingAdventures in civic hacking
Adventures in civic hacking
 
Haskell in the Real World
Haskell in the Real WorldHaskell in the Real World
Haskell in the Real World
 
Oyster: an incubator for perls in the cloud
Oyster: an incubator for perls in the cloudOyster: an incubator for perls in the cloud
Oyster: an incubator for perls in the cloud
 
Semantic Pipes (London Perl Workshop 2009)
Semantic Pipes (London Perl Workshop 2009)Semantic Pipes (London Perl Workshop 2009)
Semantic Pipes (London Perl Workshop 2009)
 
Functional Pe(a)rls
Functional Pe(a)rlsFunctional Pe(a)rls
Functional Pe(a)rls
 
Readable Perl
Readable PerlReadable Perl
Readable Perl
 
Bigbadwolf
BigbadwolfBigbadwolf
Bigbadwolf
 

Dernier

Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 

Dernier (20)

AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 

Functional Pe(a)rls version 2