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
A gentle introduction to functional programming
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Stefano Armenes
April 20, 2020
Programming
440
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
A gentle introduction to functional programming
Stefano Armenes
April 20, 2020
More Decks by Stefano Armenes
See All by Stefano Armenes
reactjs_milano_intersection_2019.pdf
stearm
0
290
React with super powers using TypeScript
stearm
0
430
Other Decks in Programming
See All in Programming
数百円から始めるRuby電子工作
tarosay
0
140
言葉の格闘技のススメ~紙とペンと言葉から始める、キャリアの描き方~
progresscicada
2
140
TSX の <Hoge<Fuga>> という構文に驚いた話 / tsx-type-argument-syntax
kanaru0928
0
210
Apache Hive: Toward a Cloud Native Lakehouse
okumin
0
180
メールのエイリアス機能を履き違えない
isshinfunada
0
220
その節約、円になってますか?
isamumumu
1
700
Cloudflare is Agents
chimame
0
140
5分で問診!Composer セキュリティ健康診断
codmoninc
0
890
全PRの83%がAIレビューだけでマージできるようになった開発組織はその後どうなったか
athug
1
1.5k
JAWS-UG横浜 #102 AWSサ終供養LT会 成仏できない AWS サービスたち 〜本日、三体供養します〜
maroon1st
0
330
Laravelで学ぶ Webアプリケーションチューニング入門/web_application_tuning_101
hanhan1978
4
1.7k
Welcome to the "Parametricity" 🏙️ − Generic だけど Specific な世界 −
guvalif
PRO
1
200
Featured
See All Featured
Test your architecture with Archunit
thirion
1
2.3k
WENDY [Excerpt]
tessaabrams
11
39k
The Hidden Cost of Media on the Web [PixelPalooza 2025]
tammyeverts
2
430
Into the Great Unknown - MozCon
thekraken
41
2.7k
Writing Fast Ruby
sferik
630
63k
Rebuilding a faster, lazier Slack
samanthasiow
85
9.6k
Leo the Paperboy
mayatellez
8
2.1k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
162
16k
How People are Using Generative and Agentic AI to Supercharge Their Products, Projects, Services and Value Streams Today
helenjbeal
1
260
Self-Hosted WebAssembly Runtime for Runtime-Neutral Checkpoint/Restore in Edge–Cloud Continuum
chikuwait
0
680
AI Search: Where Are We & What Can We Do About It?
aleyda
0
7.8k
How to train your dragon (web standard)
notwaldorf
97
6.7k
Transcript
A GENTLE INTRODUCTION TO FUNCTIONAL PROGRAMMING ENGINEERING MEETUP - 20TH
APRIL 2020 Luca Di Stefano, Luca Ruzzola, Stefano Armenes
A GENTLE INTRODUCTION TO FUNCTIONAL PROGRAMMING WHY?
A GENTLE INTRODUCTION TO FUNCTIONAL PROGRAMMING Pillars - referential transparency
- function composition - no side-effects
A GENTLE INTRODUCTION TO FUNCTIONAL PROGRAMMING No side-effects, really? -
any operation that interacts with an external system - out-of-scope resources mutations - exceptions
A GENTLE INTRODUCTION TO FUNCTIONAL PROGRAMMING ANYTHING IS A FUNCTION
…or better, an expression!
A GENTLE INTRODUCTION TO FUNCTIONAL PROGRAMMING Referential transparency is all
about expression Is this function referential transparent?
A GENTLE INTRODUCTION TO FUNCTIONAL PROGRAMMING Referential transparency is all
about expression and what about this?
A GENTLE INTRODUCTION TO FUNCTIONAL PROGRAMMING Referential transparency is all
about expression and what about this?
A GENTLE INTRODUCTION TO FUNCTIONAL PROGRAMMING Pure function A pure
function is a function that, given the same input, always returns the same output without producing any side-effect.
A GENTLE INTRODUCTION TO FUNCTIONAL PROGRAMMING Pure function A pure
function is a function that, given the same input, always returns the same output without producing any side-effect. Benefits - readability - parallelisation - memoization - more testable
A GENTLE INTRODUCTION TO FUNCTIONAL PROGRAMMING We can compose two
functions f and g when f domain is a subset of g domain. f ∘ g === f(g(x)) Composing functions
A GENTLE INTRODUCTION TO FUNCTIONAL PROGRAMMING Composing functions …but, we
are missing somethings! We can compose two functions f and g when f domain is a subset of g domain. f ∘ g === f(g(x))
A GENTLE INTRODUCTION TO FUNCTIONAL PROGRAMMING Partial functions We want
to live a world where every function is a total function Is this function total?
A GENTLE INTRODUCTION TO FUNCTIONAL PROGRAMMING Cool but, why my
computation fails? Option[T]
A GENTLE INTRODUCTION TO FUNCTIONAL PROGRAMMING Either[L, R]
A GENTLE INTRODUCTION TO FUNCTIONAL PROGRAMMING Monads are your functional
design patterns! Choose what you need IO List Option Either Set Future … Try
A GENTLE INTRODUCTION TO FUNCTIONAL PROGRAMMING DEMO
A GENTLE INTRODUCTION TO FUNCTIONAL PROGRAMMING Questions?
A GENTLE INTRODUCTION TO FUNCTIONAL PROGRAMMING Thanks!