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
1
410
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
280
React with super powers using TypeScript
stearm
0
410
Other Decks in Programming
See All in Programming
ベクトル検索のフィルタを用いた機械学習モデルとの統合 / python-meetup-fukuoka-06-vector-attr
monochromegane
2
420
How to stabilize UI tests using XCTest
akkeylab
0
130
社内規程RAGの精度を73.3% → 100%に改善した話
oharu121
13
8.1k
DSPy入門 Pythonで実現する自動プロンプト最適化 〜人手によるプロンプト調整からの卒業〜
seaturt1e
1
730
SourceGeneratorのマーカー属性問題について
htkym
0
200
モックわからないマン卒業記 ~振る舞いを起点に見直した、フロントエンドテストにおけるモックの使いどころ~
tasukuwatanabe
2
350
Claude Codeセッション現状確認 2026福岡 / fukuoka-aicoding-00-beacon
monochromegane
4
420
maplibre-gl-layers - 地図に移動体たくさん表示したい
kekyo
PRO
0
270
モジュラモノリスにおける境界をGoのinternalパッケージで守る
magavel
0
3.5k
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
540
Understanding Apache Lucene - More than just full-text search
spinscale
0
120
AIコードレビューの導入・運用と AI駆動開発における「AI4QA」の取り組みについて
hagevvashi
0
480
Featured
See All Featured
Navigating the moral maze — ethical principles for Al-driven product design
skipperchong
2
280
Beyond borders and beyond the search box: How to win the global "messy middle" with AI-driven SEO
davidcarrasco
3
72
The World Runs on Bad Software
bkeepers
PRO
72
12k
Site-Speed That Sticks
csswizardry
13
1.1k
Mind Mapping
helmedeiros
PRO
1
120
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
34
2.7k
Leveraging Curiosity to Care for An Aging Population
cassininazir
1
190
Redefining SEO in the New Era of Traffic Generation
szymonslowik
1
240
Tell your own story through comics
letsgokoyo
1
840
State of Search Keynote: SEO is Dead Long Live SEO
ryanjones
0
150
How People are Using Generative and Agentic AI to Supercharge Their Products, Projects, Services and Value Streams Today
helenjbeal
1
140
Bash Introduction
62gerente
615
210k
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!