Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Functional Programming with examples
Search
felipe
November 20, 2019
Technology
41
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Functional Programming with examples
felipe
November 20, 2019
Transcript
32 slides
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
More Decks by felipe
See All by felipe
Aplicações Flask Resilientes com Envoy e Kubernetes
felipemocruha
0
43
Desenvolvendo aplicações web com Flask e Docker
felipemocruha
0
29
Docker e Kubernetes
felipemocruha
0
58
Emacs
felipemocruha
0
24
Introdução a Python e seu Ecossistema
felipemocruha
0
24
Data Structures and Performance
felipemocruha
0
29
Observability
felipemocruha
0
40
Testes de Software
felipemocruha
0
27
Other Decks in Technology
See All in Technology
Amazon Bedrock AgentCore の基礎とセキュリティ・ガバナンス
ren8k
0
290
テスト自動化の先、テスト自律化に向けて
mineo_matsuya
3
1k
AWS DevOps Agentの構造から読み解く運用 AI エージェントの設計原則/aws-devops-agent-design-principles
tomoki10
0
320
Go でトランザクション、どう書いてますか?
knwoop
2
650
Platform Engineering をベースとした Agentic Software Factory の実践
110y
3
1.1k
FPGAでアクティブセンシングがやりたくてカメラモジュールを自作した話
ryuz88
0
150
信頼性を犠牲にせず、PR マージからデプロイまで人の介入を完全にゼロにするまでの道のり
knwoop
4
2.2k
統制されたID・権限をどう利用するか : DPoP/FAPIによるAPIセキュリティ強化
oidfj
2
360
競馬予想をAIでやってみた話
yoshimura_datam
0
160
「個社」ではなく「業界」の課題を解く AI 対話開発 ー 価値を広げる設計と、価値を守るエンジニアリング ー
ivry_presentationmaterials
4
920
Terraform 0 to 100:100個以上のリポジトリを常に最新にし続けるための自動化
sue445
3
1.5k
ワークフローからハーネスへ — Web フレームワークの作者たちが AI エージェントに向かう理由
azukiazusa1
4
3.7k
Featured
See All Featured
30 Presentation Tips
portentint
PRO
1
480
The Cult of Friendly URLs
andyhume
79
7.1k
Testing 201, or: Great Expectations
jmmastey
46
8.4k
Public Speaking Without Barfing On Your Shoes - THAT 2023
reverentgeek
1
670
Redefining SEO in the New Era of Traffic Generation
szymonslowik
1
550
A designer walks into a library…
pauljervisheath
211
25k
Avoiding the “Bad Training, Faster” Trap in the Age of AI
tmiket
1
320
Jess Joyce - The Pitfalls of Following Frameworks
techseoconnect
PRO
1
480
Reality Check: Gamification 10 Years Later
codingconduct
0
2.4k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
35
2.9k
DevOps and Value Stream Thinking: Enabling flow, efficiency and business value
helenjbeal
2
450
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
203
77k