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 Brighton Meet up: what functional pr...
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Richard Dallaway
September 27, 2011
Technology
590
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
Transcript
13 slides
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();
More Decks by Richard Dallaway
See All by Richard Dallaway
AI Roadmap
d6y
0
87
Voice to guide "difficult" recycling queries
d6y
0
100
Brighton Java: Day in the life...
d6y
0
270
Day in the Life of a Functional Programmer
d6y
0
670
Exoplanet Safari
d6y
1
520
Types Working For You
d6y
1
2.8k
Towards Browser and Server Utopia with Scala.js: an example using CRDTs
d6y
0
7.9k
Code Review Gems
d6y
1
2.1k
Woot for Lift
d6y
2
3.5k
Other Decks in Technology
See All in Technology
令和の今、あらためて IAM を考える。アクセスキーを「無くせない現実」との向き合い方
kazzpapa3
0
630
Kiro アップデート 2026 年 11 月号 (11 月 8 日時点) | 目指せ Kiro マスター アップデート編
inariku
PRO
2
110
分析作業をどこまで任せるか自分で決められる AIネイティブBI『Golden Analytics』が 良さげな話 /golden-analytics-is-ai-native-bi
shinyaa31
0
140
ライフワーク「猫でもわかるDirectConnect」
kentapapa
0
320
自治体AIコンタクトセンター、何をどこに任せる?~Amazon Connect Customer +Amazon Bedrockの実践知~ / 20261107 Satoshi Torano
shift_evolve
PRO
1
130
Kiro 入門 (1 つのエージェントを、どの画面からでも) | 目指せ Kiro マスター 01
inariku
PRO
6
1.6k
サボる子はいねぇがー!AgentCoreハーネスの脆弱性に学ぶ、エージェントの入力バリデーション
iwamot
PRO
5
330
PostgreSQL オプティマイザ統計の秘密
nori_shinoda
1
460
[JAWS Festa 2026]一番いい仕事は、請求書に現れない / jawsfesta2026
sh_fk2
2
450
Linuxネットワークスタック進化の軌跡: 過去10年の歩みと最新トレンド
orimanabu
1
330
顧客合意を取りながら進めるAWSコスト削減の実践
optim
0
160
BALLAS Technology Deck
ballas_inc
0
500
Featured
See All Featured
DevOps and Value Stream Thinking: Enabling flow, efficiency and business value
helenjbeal
2
440
DBのスキルで生き残る技術 - AI時代におけるテーブル設計の勘所
soudai
PRO
68
60k
The Language of Interfaces
destraynor
162
27k
Redefining SEO in the New Era of Traffic Generation
szymonslowik
1
520
For a Future-Friendly Web
brad_frost
184
11k
Bioeconomy Workshop: Dr. Julius Ecuru, Opportunities for a Bioeconomy in West Africa
akademiya2063
PRO
1
460
VelocityConf: Rendering Performance Case Studies
addyosmani
331
25k
Mozcon NYC 2025: Stop Losing SEO Traffic
samtorres
1
600
The #1 spot is gone: here's how to win anyway
tamaranovitovic
4
1.2k
HDC tutorial
michielstock
2
1k
SEO Brein meetup: CTRL+C is not how to scale international SEO
lindahogenes
2
3k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
12
1.9k