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 Brighton Meet up: what functional pr...
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Richard Dallaway
September 27, 2011
Technology
580
2
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Functional Brighton Meet up: what functional programming means to me.
See:
http://richard.dallaway.com/functional-brighton-presentations-on-what-fun
Richard Dallaway
September 27, 2011
More Decks by Richard Dallaway
See All by Richard Dallaway
AI Roadmap
d6y
0
67
Voice to guide "difficult" recycling queries
d6y
0
85
Brighton Java: Day in the life...
d6y
0
250
Day in the Life of a Functional Programmer
d6y
0
660
Exoplanet Safari
d6y
1
490
Types Working For You
d6y
1
2.8k
Towards Browser and Server Utopia with Scala.js: an example using CRDTs
d6y
0
7.8k
Code Review Gems
d6y
1
2k
Woot for Lift
d6y
2
3.4k
Other Decks in Technology
See All in Technology
就職⽀援サービスにおけるキャリアアドバイザーのシフトスケジューリング
recruitengineers
PRO
1
150
失敗を資産に変えるClaude Code
shinyasaita
0
690
SONiCの統計情報を取得したい
sonic
0
190
新しいVibe Codingと”自走”について
watany
6
330
【NRUG vol.18】なぜ多くのオブザーバビリティ導入は失敗するのか
nrug_member
0
170
Agent Skills設計で柔軟性と硬さのバランスが難しい話
nassy20
0
130
日本 Fintech 未来予測レポート 2027〜2028年(オリジナル版)
8maki
0
2.3k
【2026年版】 ベクトル検索䛸 Embedding最前線
mocobeta
3
670
連合学習と機密コンピューティング
lycorptech_jp
PRO
0
120
攻撃者視点で考えるDetection Engineering
cryptopeg
3
1.9k
GitHub Copilot 最新アップデート – 「一歩先」の実践活用術
moulongzhang
4
1.3k
FinOps × AIエージェントで実現する コストインシデントの自動調査
oasis1994liveforever
0
150
Featured
See All Featured
DevOps and Value Stream Thinking: Enabling flow, efficiency and business value
helenjbeal
1
240
New Earth Scene 8
popppiees
3
2.3k
Keith and Marios Guide to Fast Websites
keithpitt
413
23k
Side Projects
sachag
455
43k
Writing Fast Ruby
sferik
630
63k
Building a Modern Day E-commerce SEO Strategy
aleyda
45
9.1k
Leadership Guide Workshop - DevTernity 2021
reverentgeek
1
300
Applied NLP in the Age of Generative AI
inesmontani
PRO
4
2.3k
Faster Mobile Websites
deanohume
310
31k
What the history of the web can teach us about the future of AI
inesmontani
PRO
1
610
A better future with KSS
kneath
240
18k
Rebuilding a faster, lazier Slack
samanthasiow
85
9.5k
Transcript
Three things I’ve noticed about functional programming while using Scala.
happy birthday to me happy birthday to me #lol #omg
oops #lol oops #lol #omg 㱺 㱺 ⋮ ⋮ What have we have? What do we want?
#lol, #omg & some text Some text 㱺 What have
we have? What do we want?
#lol, #omg & some text Some text 㱺 What have
we have? What do we want? List[String], String 㱺 String
def appendTags(tweet: String, tags: List[String]) = tags.foldLeft(tweet) { appendOne }
def appendOne(tweet: String, tag: String) = if (tweet contains tag) tweet else tweet+" "+tag
“It’s the mutable state, stupid.” – Göetz et al.
val results = List(yahoo _, google _).par.map(_.apply)
import scala.actors.Futures._ val results = List(yahoo _, google _) map
( f 㱺 future{ f() } ) map (_.apply)
Option, for comprehensions, flatMap & pattern matching are astonishingly useful
every day and I’d never heard of them before learning Scala.
for (int i = 0; i < resultFeed.getEntries().size(); i++) {
ContactEntry entry = resultFeed.getEntries().get(i); if (entry.hasName()) { Name name = entry.getName(); if (name.hasFullName()) { ...
for { entry ← resultFeed.getEntries name ← Option(entry.getName) full_name ←
Option(name.getFullName) birthday ← Option(entry.getBirthday) } yield "%s: %s".format(full_name.getValue, when)
1. Thinking in terms of A 㱺 B 2. Concurrency
3. Option (& friends) change everything Summary
StringBuffer b = new StringBuffer(tweet); if (tags != null) {
for(String tag: tags) { if (tag != null && b.indexOf(tag) == -1) { b.append(tag).append(“ ”); } } } return b.toString();