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
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
Contract One Engineering Unit 紹介資料
sansan33
PRO
0
13k
30万人の同時アクセスに耐えたい!新サービスの盤石なリリースを支える負荷試験 / SRE Kaigi 2026
genda
3
1.1k
モダンUIでフルサーバーレスなAIエージェントをAmplifyとCDKでサクッとデプロイしよう
minorun365
4
170
広告の効果検証を題材にした因果推論の精度検証について
zozotech
PRO
0
150
Context Engineeringの取り組み
nutslove
0
320
なぜ今、コスト最適化(倹約)が必要なのか? ~AWSでのコスト最適化の進め方「目的編」~
htan
1
110
インフラエンジニア必見!Kubernetesを用いたクラウドネイティブ設計ポイント大全
daitak
0
340
コスト削減から「セキュリティと利便性」を担うプラットフォームへ
sansantech
PRO
3
1.4k
予期せぬコストの急増を障害のように扱う――「コスト版ポストモーテム」の導入とその後の改善
muziyoshiz
1
1.7k
月間数億レコードのアクセスログ基盤を無停止・低コストでAWS移行せよ!アプリケーションエンジニアのSREチャレンジ💪
miyamu
0
840
15 years with Rails and DDD (AI Edition)
andrzejkrzywda
0
180
IaaS/SaaS管理における SREの実践 - SRE Kaigi 2026
bbqallstars
4
1.8k
Featured
See All Featured
Understanding Cognitive Biases in Performance Measurement
bluesmoon
32
2.8k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
47
7.9k
How Fast Is Fast Enough? [PerfNow 2025]
tammyeverts
3
450
The Curious Case for Waylosing
cassininazir
0
230
Git: the NoSQL Database
bkeepers
PRO
432
66k
Building AI with AI
inesmontani
PRO
1
690
Agile Leadership in an Agile Organization
kimpetersen
PRO
0
79
The Pragmatic Product Professional
lauravandoore
37
7.1k
Introduction to Domain-Driven Design and Collaborative software design
baasie
1
580
[RailsConf 2023] Rails as a piece of cake
palkan
59
6.3k
BBQ
matthewcrist
89
10k
Gemini Prompt Engineering: Practical Techniques for Tangible AI Outcomes
mfonobong
2
280
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?