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
Boulder Startup Week: What is functional progra...
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Brian McKenna
May 13, 2014
Programming
68
0
Share
Boulder Startup Week: What is functional programming?
Brian McKenna
May 13, 2014
More Decks by Brian McKenna
See All by Brian McKenna
Production PureScript
puffnfresh
0
120
PureScript
puffnfresh
2
590
LambdaConf: Idris Workshop
puffnfresh
2
130
Other Decks in Programming
See All in Programming
AIエージェントで業務改善してみた
taku271
0
490
Symfonyの特性(設計思想)を手軽に活かす特性(trait)
ickx
0
130
Java 21/25 Virtual Threads 소개
debop
0
330
「速くなった気がする」をデータで疑う
senleaf24
0
150
瑠璃の宝石に学ぶ技術の声の聴き方 / 【劇場版】アニメから得た学びを発表会2026 #エンジニアニメ
mazrean
0
170
野球解説AI Agentを開発してみた - 2026/02/27 LayerX社内LT会資料
shinyorke
PRO
0
400
事業会社でのセキュリティ長期インターンについて
masachikaura
0
230
我々はなぜ「層」を分けるのか〜「関心の分離」と「抽象化」で手に入れる変更に強いシンプルな設計〜 #phperkaigi / PHPerKaigi 2026
shogogg
2
810
条件判定に名前、つけてますか? #phperkaigi #c
77web
2
970
20260320登壇資料
pharct
0
160
Swift Concurrency Type System
inamiy
0
290
AI時代の脳疲弊と向き合う ~言語学としてのPHP~
sakuraikotone
1
1.8k
Featured
See All Featured
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
54k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
508
140k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
27k
It's Worth the Effort
3n
188
29k
Why You Should Never Use an ORM
jnunemaker
PRO
61
9.8k
The Spectacular Lies of Maps
axbom
PRO
1
680
Bioeconomy Workshop: Dr. Julius Ecuru, Opportunities for a Bioeconomy in West Africa
akademiya2063
PRO
1
88
Are puppies a ranking factor?
jonoalderson
1
3.2k
Ruling the World: When Life Gets Gamed
codingconduct
0
190
GraphQLとの向き合い方2022年版
quramy
50
14k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
32
2.7k
Typedesign – Prime Four
hannesfritz
42
3k
Transcript
FUNCTIONAL PROGRAMMING
WHAT ARE FUNCTIONS?
▸ A relation from a set to a set {(true,
false), (false, true), (false, false)} ▸ One output object for every input {(true, false), (false, true)}
ACTUAL FUNCTIONS
boolean not(boolean b) { return !b; } String hello(String s)
{ return "Hello " + s; }
NOT FUNCTIONS
System.out.println("Hello world"); System.getTimeMillis(); x = x + 1; boolean update(int
j) { i += j; return j + 1; }
... functional programming is a restriction on how we write
programs, but not on what programs we can express. — Rúnar Bjarnason and Paul Chiusano, Functional Programming in Scala, 2014
EQUATIONAL REASONING
main :: IO () main = print $ sum [1,
2, 3] sum :: [Int] -> Int sum = foldl (+) 0 foldl :: (Int -> Int -> Int) -> Int -> [Int] -> Int foldl f z xs = go z xs where go z [] = z go z (x:xs) = go (f z x) xs
main :: IO () main = print $ sum [1,
2, 3] sum :: [Int] -> Int sum xs = go 0 xs where go z [] = z go z (x:xs) = go (z + x) xs
main :: IO () main = print sum' sum' ::
Int sum' = go 0 [1, 2, 3] where go z [] = z go z (x:xs) = go (z + x) xs
main :: IO () main = print sum' sum' ::
Int sum' = go (((0 + 1) + 2) + 3) [] where go z [] = z
main :: IO () main = print sum' sum' ::
Int sum' = (((0 + 1) + 2) + 3)
main :: IO () main = print sum' sum' ::
Int sum' = 6
main :: IO () main = print 6
NOT EQUATIONAL REASONING
val x = { println("Hello"); 1 } x + x
// Hello // 2
{ println("Hello"); 1 } + { println("Hello"); 1 } //
Hello // Hello // 2
PRINCIPLE OF COMPOSITIONALITY
Meaning of a complex statement is the combination of the
meanings of its parts.
COMPROMISING
Can we write partially functional programs?
TOOLS
▸ Haskell ▸ ML ▸ Scala ▸ F#
GO WRITE FUNCTIONS!