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
Functional Programming with examples
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
felipe
November 20, 2019
Technology
0
28
Functional Programming with examples
felipe
November 20, 2019
Tweet
Share
More Decks by felipe
See All by felipe
Aplicações Flask Resilientes com Envoy e Kubernetes
felipemocruha
0
36
Desenvolvendo aplicações web com Flask e Docker
felipemocruha
0
23
Docker e Kubernetes
felipemocruha
0
42
Emacs
felipemocruha
0
20
Introdução a Python e seu Ecossistema
felipemocruha
0
18
Data Structures and Performance
felipemocruha
0
23
Observability
felipemocruha
0
34
Testes de Software
felipemocruha
0
13
Other Decks in Technology
See All in Technology
GitHub Issue Templates + Coding Agentで簡単みんなでIaC/Easy IaC for Everyone with GitHub Issue Templates + Coding Agent
aeonpeople
1
200
学生・新卒・ジュニアから目指すSRE
hiroyaonoe
2
580
Greatest Disaster Hits in Web Performance
guaca
0
190
日本の85%が使う公共SaaSは、どう育ったのか
taketakekaho
1
150
顧客との商談議事録をみんなで読んで顧客解像度を上げよう
shibayu36
0
210
予期せぬコストの急増を障害のように扱う――「コスト版ポストモーテム」の導入とその後の改善
muziyoshiz
1
1.8k
~Everything as Codeを諦めない~ 後からCDK
mu7889yoon
3
310
SREのプラクティスを用いた3領域同時 マネジメントへの挑戦 〜SRE・情シス・セキュリティを統合した チーム運営術〜
coconala_engineer
2
630
会社紹介資料 / Sansan Company Profile
sansan33
PRO
15
400k
インフラエンジニア必見!Kubernetesを用いたクラウドネイティブ設計ポイント大全
daitak
0
340
GitLab Duo Agent Platform × AGENTS.md で実現するSpec-Driven Development / GitLab Duo Agent Platform × AGENTS.md
n11sh1
0
130
広告の効果検証を題材にした因果推論の精度検証について
zozotech
PRO
0
150
Featured
See All Featured
What’s in a name? Adding method to the madness
productmarketing
PRO
24
3.9k
Optimizing for Happiness
mojombo
379
71k
Paper Plane (Part 1)
katiecoart
PRO
0
4k
Primal Persuasion: How to Engage the Brain for Learning That Lasts
tmiket
0
250
Agile Leadership in an Agile Organization
kimpetersen
PRO
0
79
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
25
1.7k
Become a Pro
speakerdeck
PRO
31
5.8k
Agile that works and the tools we love
rasmusluckow
331
21k
Evolving SEO for Evolving Search Engines
ryanjones
0
120
Information Architects: The Missing Link in Design Systems
soysaucechin
0
770
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
9
1.2k
The SEO Collaboration Effect
kristinabergwall1
0
350
Transcript
functional programming with examples 1
2 Lambda Calculus (1930) LISP (1958) ML (1973) John Backus
Paper (1978) Haskell (1990) SICP (1985) Clojure (2007) Idris (2012)
3
pure functions 4
immutability 5 >>> a = [1, 2, 3, 4] >>>
a.append(5) >>> a [1, 2, 3, 4, 5] >>> from pyrsistent import pvector >>> a = pvector([1, 2, 3, 4]) >>> a.append(5) pvector([1, 2, 3, 4, 5]) >>> a pvector([1, 2, 3, 4])
immutability 6 list plist access O(1) O(log32 n) -> Na
prática O(1) append O(1) O(log32 n) -> Na prática O(1)
immutability 7
currying 8
closures 9
partial application 10
partial application 11
partial application 12
partial application 13
lazy evaluation 14
lazy evaluation 15
higher-order functions 16
higher-order functions 17
higher-order functions 18
higher-order functions 19
recursion 20
function composition 21
function composition 22
pattern matching 23
DISCLAIMER Strange stuff ahead! 24
algebraic data types (ADT) - product types 25
algebraic data types (ADT) - sum types 26
algebraic data types (ADT) - sum types 27
“A typeclass is a sort of interface that defines some
behavior. If a type is a part of a typeclass, that means that it supports and implements the behavior the typeclass describes.” Learn You a Haskell for Great Good! type classes 28
type classes 29
type classes - functor 30
type classes - applicatives and monads http://www.adit.io/posts/2013-04-17-functors,_applicatives,_ and_monads_in_pictures.html 31
where to learn more? 32 • https://purelyfunctional.tv/article/ • https://www.cs.kent.ac.uk/people/staff/dat/miranda/whyfp9 0.pdf
• https://www.amazon.com/dp/1617291412/ref=cm_sw_r_cp_ep_dp _TIbkAbAM04EN7 • https://lispcast.com/category/writing/ • https://www.youtube.com/user/DrBartosz/playlists