Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Fun Ruby
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Guilherme Carlos
July 03, 2015
Technology
0
98
Fun Ruby
Functional Programming concepts in Ruby
Guilherme Carlos
July 03, 2015
Tweet
Share
More Decks by Guilherme Carlos
See All by Guilherme Carlos
What's new in Rails 5?
gtcarlos
0
89
Other Decks in Technology
See All in Technology
2人で作ったAIダッシュボードが、開発組織の次の一手を照らした話― Cursor × SpecKit × 可視化の実践 ― Qiita AI Summit
noalisaai
1
370
CDK対応したAWS DevOps Agentを試そう_20260201
masakiokuda
1
200
オープンウェイトのLLMリランカーを契約書で評価する / searchtechjp
sansan_randd
3
650
広告の効果検証を題材にした因果推論の精度検証について
zozotech
PRO
0
120
Context Engineeringの取り組み
nutslove
0
280
Bill One 開発エンジニア 紹介資料
sansan33
PRO
4
17k
データの整合性を保ちたいだけなんだ
shoheimitani
8
2.9k
顧客の言葉を、そのまま信じない勇気
yamatai1212
1
340
Embedded SREの終わりを設計する 「なんとなく」から計画的な自立支援へ
sansantech
PRO
3
2.1k
フルカイテン株式会社 エンジニア向け採用資料
fullkaiten
0
10k
月間数億レコードのアクセスログ基盤を無停止・低コストでAWS移行せよ!アプリケーションエンジニアのSREチャレンジ💪
miyamu
0
800
ファインディの横断SREがTakumi byGMOと取り組む、セキュリティと開発スピードの両立
rvirus0817
1
1.1k
Featured
See All Featured
HU Berlin: Industrial-Strength Natural Language Processing with spaCy and Prodigy
inesmontani
PRO
0
200
BBQ
matthewcrist
89
10k
Leo the Paperboy
mayatellez
4
1.4k
Collaborative Software Design: How to facilitate domain modelling decisions
baasie
0
130
Color Theory Basics | Prateek | Gurzu
gurzu
0
190
Amusing Abliteration
ianozsvald
0
96
How to Think Like a Performance Engineer
csswizardry
28
2.4k
Ethics towards AI in product and experience design
skipperchong
2
190
職位にかかわらず全員がリーダーシップを発揮するチーム作り / Building a team where everyone can demonstrate leadership regardless of position
madoxten
56
50k
How To Stay Up To Date on Web Technology
chriscoyier
791
250k
Rails Girls Zürich Keynote
gr2m
96
14k
Beyond borders and beyond the search box: How to win the global "messy middle" with AI-driven SEO
davidcarrasco
1
49
Transcript
Fun Ruby Functional Programming concepts in Ruby
Who? Guilherme Carlos 23 Computer Information Systems PUC Campinas @gtcarlos_
gtcarlos
Functional Programming?
None
None
Lambda Calculus 1930s Alonzo Church (Princeton) Lambda Currying Immutability Pure
Functions
LISP 1959 John McCarthy (MIT) Lambda Calculus applied Symbols Garbage
Collector
FP in a Nutshell ➔ Anonymous Functions ➔ Higher Order
Functions ➔ Immutability ➔ No Side-Effects
Ruby is not a functional language! but have some functional
traits
Anonymous Function
Closures
None
➔ Anonymous Functions (Lambda) ➔ Higher Order Functions ➔ Immutability
➔ No Side-Effects
➔ Accept a function as an argument ➔ Return a
function as the return value Higher Order Function
Blocks everywhere!
Enumerable
➔ Anonymous Functions (Lambda) ➔ Higher Order Functions ➔ Immutability
➔ No Side-Effects
Immutability “Much of Ruby, especially its runtime, is much closer
to Python's [than Perl's], with the exception of Ruby's mutable strings, which I find an abomination.” - Guido van Rossum (Python creator)
None
None
None
Bang!
➔ Anonymous Functions (Lambda) ➔ Higher Order Functions ➔ Immutability
➔ No Side-Effects
Pure Functions ➔ The function always evaluates the same result
value given the same argument value ➔ Evaluation of the result does not cause any semantically observable side effect or output
None
None
➔ Anonymous Functions (Lambda) ➔ Higher Order Functions ➔ Immutability
➔ No Side-Effects
Advantages of FP ➔ Best readability ➔ Modularity ➔ Concurrency
➔ Testability
Disadvantages of FP ➔ Not suited to every problem ➔
Academic stuff
Rolling in the Deep Elixir Clojure Scala
Questions?