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
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Richard Dallaway
September 27, 2011
Technology
580
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
61
Voice to guide "difficult" recycling queries
d6y
0
81
Brighton Java: Day in the life...
d6y
0
250
Day in the Life of a Functional Programmer
d6y
0
660
Exoplanet Safari
d6y
1
480
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
2k
Woot for Lift
d6y
2
3.3k
Other Decks in Technology
See All in Technology
「使われるデータ基盤」を目指してデータアナリストとワークショップをやった話
jackojacko_
2
930
イベントストーミングとKiroの仕様駆動開発で実現する要件の認識合わせプロセス
syobochim
7
940
類似画像検索モデルの開発ノウハウ
lycorptech_jp
PRO
4
1k
Java正規表現エンジン(NFA)の仕組みと パフォーマンスを維持するための最適化手法
takeuchi_132917
0
150
はじめてのDatadog
kairim0
0
220
最低限これだけ押さえれ大丈夫_Claude Enterprise/Team企業展開ガバナンス入門
tkikuchi
1
530
GitHub Copilot のこれまでとこれから: From Copilot to Collaborative Agents
yuriemori
1
230
layerx-fde-practices
cipepser
6
2.9k
Oracle AI Database@AWS:サービス概要のご紹介
oracle4engineer
PRO
4
2.7k
形式手法特論:公平性制約の位相的特徴づけ #kernelvm / Kernel VM Study Kansai 12th
ytaka23
1
570
AIガバナンス実践 - 生成AIコネクタのデータ漏洩リスクと実務対策
knishioka
0
140
AIが変えた"品質の守り方"
kkakizaki
13
5.3k
Featured
See All Featured
Information Architects: The Missing Link in Design Systems
soysaucechin
0
940
Design in an AI World
tapps
1
220
Building the Perfect Custom Keyboard
takai
2
780
Mozcon NYC 2025: Stop Losing SEO Traffic
samtorres
1
240
What the history of the web can teach us about the future of AI
inesmontani
PRO
1
590
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
31
3.2k
Why Your Marketing Sucks and What You Can Do About It - Sophie Logan
marketingsoph
0
160
Google's AI Overviews - The New Search
badams
0
1k
Embracing the Ebb and Flow
colly
88
5.1k
The Limits of Empathy - UXLibs8
cassininazir
1
340
brightonSEO & MeasureFest 2025 - Christian Goodrich - Winning strategies for Black Friday CRO & PPC
cargoodrich
3
710
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
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();