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
Richard Dallaway
September 27, 2011
Technology
2
550
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
Tweet
Share
More Decks by Richard Dallaway
See All by Richard Dallaway
AI Roadmap
d6y
0
42
Voice to guide "difficult" recycling queries
d6y
0
57
Brighton Java: Day in the life...
d6y
0
220
Day in the Life of a Functional Programmer
d6y
0
630
Exoplanet Safari
d6y
1
440
Types Working For You
d6y
1
2.7k
Towards Browser and Server Utopia with Scala.js: an example using CRDTs
d6y
0
7.7k
Code Review Gems
d6y
1
1.9k
Woot for Lift
d6y
2
3.3k
Other Decks in Technology
See All in Technology
【AWS reInvent 2025 関西組 事前勉強会】re:Inventの“感動と興奮”を思い出してモチベ爆上げしたいです
ttelltte
0
120
開発者が知っておきたい複雑さの正体/where-the-complexity-comes-from
hanhan1978
6
2.2k
技術の総合格闘技!?AIインフラの現在と未来。
ebiken
PRO
0
220
Design and implementation of "Markdown to Google Slides" / phpconfuk 2025
k1low
1
370
マーケットプレイス版Oracle WebCenter Content For OCI
oracle4engineer
PRO
3
1.3k
Snowflakeとdbtで加速する 「TVCMデータで価値を生む組織」への進化論 / Evolving TVCM Data Value in TELECY with Snowflake and dbt
carta_engineering
2
220
LLM APIを2年間本番運用して苦労した話
ivry_presentationmaterials
16
11k
Black Hat USA 2025 Recap ~ クラウドセキュリティ編 ~
kyohmizu
0
300
2025 DHI Lightning Talks
digitalfellow
0
140
短期間でRAGシステムを実現 お客様と歩んだ生成AI内製化への道のり
taka0709
1
240
ソフトウェアエンジニアとデータエンジニアの違い・キャリアチェンジ
mtpooh
1
720
InsightX 会社説明資料/ Company deck
insightx
0
240
Featured
See All Featured
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
26
3.2k
Gamification - CAS2011
davidbonilla
81
5.5k
What’s in a name? Adding method to the madness
productmarketing
PRO
24
3.7k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
658
61k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
12
1.3k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
162
15k
Building an army of robots
kneath
306
46k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
192
56k
Writing Fast Ruby
sferik
630
62k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
34
2.5k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
23
1.5k
Producing Creativity
orderedlist
PRO
348
40k
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();