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
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Brian McKenna
May 13, 2014
Programming
0
67
Boulder Startup Week: What is functional programming?
Brian McKenna
May 13, 2014
Tweet
Share
More Decks by Brian McKenna
See All by Brian McKenna
Production PureScript
puffnfresh
0
110
PureScript
puffnfresh
2
590
LambdaConf: Idris Workshop
puffnfresh
2
130
Other Decks in Programming
See All in Programming
AI活用のコスパを最大化する方法
ochtum
0
120
Ruby x Terminal
a_matsuda
5
550
Claude Codeと2つの巻き戻し戦略 / Two Rewind Strategies with Claude Code
fruitriin
0
200
CSC307 Lecture 11
javiergs
PRO
0
580
AI時代でも変わらない技術コミュニティの力~10年続く“ゆるい”つながりが生み出す価値
n_takehata
2
580
AIによる開発の民主化を支える コンテキスト管理のこれまでとこれから
mulyu
3
2.2k
コーディングルールの鮮度を保ちたい / keep-fresh-go-internal-conventions
handlename
0
140
Rで始めるML・LLM活用入門
wakamatsu_takumu
0
140
モジュラモノリスにおける境界をGoのinternalパッケージで守る
magavel
0
3.4k
Go 1.26でのsliceのメモリアロケーション最適化 / Go 1.26 リリースパーティ #go126party
mazrean
1
330
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
170
Beyond the Basics: Signal Forms
manfredsteyer
PRO
0
110
Featured
See All Featured
Leveraging LLMs for student feedback in introductory data science courses - posit::conf(2025)
minecr
1
190
SEOcharity - Dark patterns in SEO and UX: How to avoid them and build a more ethical web
sarafernandez
0
130
Why Mistakes Are the Best Teachers: Turning Failure into a Pathway for Growth
auna
0
71
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
31
3.1k
Believing is Seeing
oripsolob
1
68
How to Grow Your eCommerce with AI & Automation
katarinadahlin
PRO
1
130
技術選定の審美眼(2025年版) / Understanding the Spiral of Technologies 2025 edition
twada
PRO
117
110k
How to Talk to Developers About Accessibility
jct
2
140
Game over? The fight for quality and originality in the time of robots
wayneb77
1
130
The browser strikes back
jonoalderson
0
750
VelocityConf: Rendering Performance Case Studies
addyosmani
333
24k
How to Build an AI Search Optimization Roadmap - Criteria and Steps to Take #SEOIRL
aleyda
1
1.9k
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!