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
570
2
Share
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
56
Voice to guide "difficult" recycling queries
d6y
0
75
Brighton Java: Day in the life...
d6y
0
240
Day in the Life of a Functional Programmer
d6y
0
650
Exoplanet Safari
d6y
1
480
Types Working For You
d6y
1
2.7k
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.3k
Other Decks in Technology
See All in Technology
実践ハーネスエンジニアリング:TAKTで実現するAIエージェント制御 / Practical Harness Engineering: AI Agent Control Enabled by TAKT
nrslib
12
4.9k
Practical TypeProf: Lessons from Analyzing Optcarrot
mame
0
1.1k
AzureのIaC管理からログ調査まで、随所に役立つSkillsとCustom-Instructions / Boosting IaC and Log Analysis with Skills
aeonpeople
0
260
生成AIが変える SaaS の競争原理と弁護士ドットコムのプロダクト戦略
bengo4com
1
2.3k
Standards et agents IA : un tour d’horizon de MCP, A2A, ADK et plus encore
glaforge
0
190
PicoRuby as a Multi-VM Operating System
kishima
1
210
Keeping Ruby Running on Cygwin
fd0
0
180
Microsoft 365 / Microsoft 365 Copilot : 自分の状態を確認する「ラベル」について
taichinakamura
0
350
AI時代 に増える データ活用先
takahal
0
320
Anthropic「Long-running a gents」をGeminiで再現してみた
tkikuchi
0
240
AIはハッカーを減らすのか、増やすのか?──現役ホワイトハッカーから見るAI時代のリアル【MEGU-Meet】
cscengineer
PRO
0
200
エージェントスキルを作って自分のインプットに役立てよう
tsubakimoto_s
0
440
Featured
See All Featured
世界の人気アプリ100個を分析して見えたペイウォール設計の心得
akihiro_kokubo
PRO
69
39k
The Language of Interfaces
destraynor
162
26k
A Modern Web Designer's Workflow
chriscoyier
698
190k
Marketing Yourself as an Engineer | Alaka | Gurzu
gurzu
0
180
Agile Actions for Facilitating Distributed Teams - ADO2019
mkilby
0
180
The #1 spot is gone: here's how to win anyway
tamaranovitovic
2
1k
The Director’s Chair: Orchestrating AI for Truly Effective Learning
tmiket
1
150
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
130k
Navigating Team Friction
lara
192
16k
Noah Learner - AI + Me: how we built a GSC Bulk Export data pipeline
techseoconnect
PRO
0
160
Darren the Foodie - Storyboard
khoart
PRO
3
3.3k
Skip the Path - Find Your Career Trail
mkilby
1
110
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();