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
41
Voice to guide "difficult" recycling queries
d6y
0
52
Brighton Java: Day in the life...
d6y
0
220
Day in the Life of a Functional Programmer
d6y
0
620
Exoplanet Safari
d6y
1
430
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.2k
Other Decks in Technology
See All in Technology
Bliki (ja), and the Cathedral, and the Bazaar
koic
8
1.5k
ML Pipelineの開発と運用を OpenTelemetryで繋ぐ @ OpenTelemetry Meetup 2025-07
getty708
0
300
P2P ではじめる WebRTC のつまづきどころ
tnoho
1
260
Microsoft Learn MCP/Fabric データエージェント/Fabric MCP/Copilot Studio-簡単・便利なAIエージェント作ってみた
reireireijinjin6
1
110
20150719_Amazon Nova Canvas Virtual try-onアプリ 作成裏話
riz3f7
0
140
エンジニアリングマネージャー“お悩み相談”パネルセッション
ar_tama
1
740
Semantic Machine Intelligence for Vision, Language, and Actions
keio_smilab
PRO
2
410
AIに全任せしないコーディングとマネジメント思考
kikuchikakeru
0
240
Ktor + Google Cloud Tasks/PubSub におけるOTel Messaging計装の実践
sansantech
PRO
1
320
FAST導入1年間のふりかえり〜現実を直視し、さらなる進化を求めて〜 / Review of the first year of FAST implementation
wooootack
1
170
「AI駆動開発」のボトルネック『言語化』を効率化するには
taniiicom
1
200
AIを使っていい感じにE2Eテストを書けるようになるまで / Trying to Write Good E2E Tests with AI
katawara
3
1.8k
Featured
See All Featured
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
229
22k
Why You Should Never Use an ORM
jnunemaker
PRO
58
9.5k
Writing Fast Ruby
sferik
628
62k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
126
53k
[RailsConf 2023] Rails as a piece of cake
palkan
55
5.7k
Agile that works and the tools we love
rasmusluckow
329
21k
Stop Working from a Prison Cell
hatefulcrawdad
271
21k
How to Think Like a Performance Engineer
csswizardry
25
1.8k
A better future with KSS
kneath
238
17k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
31
1.3k
Speed Design
sergeychernyshev
32
1k
Code Reviewing Like a Champion
maltzj
524
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();