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
Stefano Armenes
April 20, 2020
Programming
1
380
A gentle introduction to functional programming
Stefano Armenes
April 20, 2020
Tweet
Share
More Decks by Stefano Armenes
See All by Stefano Armenes
reactjs_milano_intersection_2019.pdf
stearm
0
270
React with super powers using TypeScript
stearm
0
390
Other Decks in Programming
See All in Programming
2025 年のコーディングエージェントの現在地とエンジニアの仕事の変化について
azukiazusa1
24
12k
Namespace and Its Future
tagomoris
6
700
Ruby×iOSアプリ開発 ~共に歩んだエコシステムの物語~
temoki
0
300
テストカバレッジ100%を10年続けて得られた学びと品質
mottyzzz
2
590
はじめてのMaterial3 Expressive
ym223
2
350
HTMLの品質ってなんだっけ? “HTMLクライテリア”の設計と実践
unachang113
4
2.8k
知っているようで知らない"rails new"の世界 / The World of "rails new" You Think You Know but Don't
luccafort
PRO
1
140
Vue・React マルチプロダクト開発を支える Vite
andpad
0
110
print("Hello, World")
eddie
2
530
モバイルアプリからWebへの横展開を加速した話_Claude_Code_実践術.pdf
kazuyasakamoto
0
330
プロパティベーステストによるUIテスト: LLMによるプロパティ定義生成でエッジケースを捉える
tetta_pdnt
0
330
Kiroで始めるAI-DLC
kaonash
2
590
Featured
See All Featured
Rails Girls Zürich Keynote
gr2m
95
14k
Building Applications with DynamoDB
mza
96
6.6k
How to train your dragon (web standard)
notwaldorf
96
6.2k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
16k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
53k
KATA
mclloyd
32
14k
The Straight Up "How To Draw Better" Workshop
denniskardys
236
140k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
162
15k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
229
22k
Making Projects Easy
brettharned
117
6.4k
The Cost Of JavaScript in 2023
addyosmani
53
8.9k
The Cult of Friendly URLs
andyhume
79
6.6k
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!