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
felipe
November 20, 2019
Technology
0
23
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
24
Desenvolvendo aplicações web com Flask e Docker
felipemocruha
0
13
Docker e Kubernetes
felipemocruha
0
27
Emacs
felipemocruha
0
16
Introdução a Python e seu Ecossistema
felipemocruha
0
10
Data Structures and Performance
felipemocruha
0
18
Observability
felipemocruha
0
27
Testes de Software
felipemocruha
0
9
Other Decks in Technology
See All in Technology
推しは推せるときに推せ! プロダクトにフィードバックしていこう
nakasho
0
380
本当のAWS基礎
toru_kubota
0
540
Microsoft Intune 勉強会 第 2 回目
tamaiyutaro
1
190
Building a RAG-poweredAI chat appwith Python and VS Code
pamelafox
0
110
BPStudyの200回を中心にIT業界を振り返る。そしてこれから
haru860
2
200
DMM.com アルファ室採用案内資料
hsugita
1
170
Além do else! Categorizando Pokemóns com Pattern Matching no JavaScript
wmsbill
0
650
LLM開発・活用の舞台裏@2024.04.25
yushin_n
3
830
ルーターでプレゼンする
puhitaku
0
690
プラットフォームってつくることより計測することが重要なんじゃないかという話 / Platform Engineering Meetup #8
taishin
1
370
Delivering Millions of Messages within seconds @ Duolingo
pelelgrino
0
350
Android Target SDK 35 (Android 15) 対応の概要
akkie76
0
110
Featured
See All Featured
Faster Mobile Websites
deanohume
299
30k
Thoughts on Productivity
jonyablonski
58
3.8k
Raft: Consensus for Rubyists
vanstee
132
6.3k
Typedesign – Prime Four
hannesfritz
36
2.1k
Debugging Ruby Performance
tmm1
70
11k
Designing Experiences People Love
moore
136
23k
Writing Fast Ruby
sferik
621
60k
Pencils Down: Stop Designing & Start Developing
hursman
117
11k
5 minutes of I Can Smell Your CMS
philhawksworth
199
19k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
34
8.9k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
6
1.5k
Fontdeck: Realign not Redesign
paulrobertlloyd
76
4.9k
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