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
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
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
More Decks by Richard Dallaway
See All by Richard Dallaway
AI Roadmap
d6y
0
76
Voice to guide "difficult" recycling queries
d6y
0
95
Brighton Java: Day in the life...
d6y
0
270
Day in the Life of a Functional Programmer
d6y
0
670
Exoplanet Safari
d6y
1
510
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
2.1k
Woot for Lift
d6y
2
3.4k
Other Decks in Technology
See All in Technology
事業課題から技術的負債に向き合う
sansantech
PRO
1
220
目の前の楽しいが人生を変える - コミュニティの螺旋の歩き方と楽しむコツ / change your life
soudai
PRO
4
530
ASTを使って影響範囲を特定する
nealle
0
180
2026/09/10 Spring Bootから Jakarta EE/MicroProfileへの移行
megascus
0
350
10Xに技術的負債をもたらした「2つの境界の歪み」その構造と解消への営み
10xinc
0
380
Claude in Chrome 入門 / Introduction to Claude in Chrome
cielo1985
0
620
The Agent Builder Loop from Daily Work to OSS
minorun365
PRO
3
150
GoにおけるFFIのこれまでとこれから
goccy
5
2.5k
家のリアーキテクト・リファクタリング
suguruooki
0
130
enechainの内製セルフサービスプラットフォーム
hiyosi
0
160
AIエージェントの自己改善をどう設計するか / How to Design Self-Improvement for AI Agents
22mi
14
8.5k
AIオーケストレーションを活用した 開発ワークフローの設計と実践
bqnq
0
150
Featured
See All Featured
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
35
2.6k
Impact Scores and Hybrid Strategies: The future of link building
tamaranovitovic
0
440
The AI Search Optimization Roadmap by Aleyda Solis
aleyda
1
6.2k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
128
56k
エンジニアに許された特別な時間の終わり
watany
108
250k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
249
1.3M
SEO Brein meetup: CTRL+C is not how to scale international SEO
lindahogenes
1
2.9k
Information Architects: The Missing Link in Design Systems
soysaucechin
1
1.1k
Making the Leap to Tech Lead
cromwellryan
135
10k
How to optimise 3,500 product descriptions for ecommerce in one day using ChatGPT
katarinadahlin
PRO
2
3.8k
What the history of the web can teach us about the future of AI
inesmontani
PRO
1
690
How to Think Like a Performance Engineer
csswizardry
28
2.8k
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();