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
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
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
48
Voice to guide "difficult" recycling queries
d6y
0
62
Brighton Java: Day in the life...
d6y
0
230
Day in the Life of a Functional Programmer
d6y
0
640
Exoplanet Safari
d6y
1
460
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
2k
Woot for Lift
d6y
2
3.3k
Other Decks in Technology
See All in Technology
Azure SQL Databaseでベクター検索を活用しよう
nakasho
0
130
最速で価値を出すための プロダクトエンジニアのツッコミ術
kaacun
1
410
書籍執筆での生成AIの活用
sat
PRO
1
230
オープンウェイトのLLMリランカーを契約書で評価する / searchtechjp
sansan_randd
3
450
それぞれのペースでやっていく Bet AI / Bet AI at Your Own Pace
yuyatakeyama
1
680
Oracle Cloud Infrastructure:2026年1月度サービス・アップデート
oracle4engineer
PRO
0
190
VRTと真面目に向き合う
hiragram
1
510
Regional_NAT_Gatewayについて_basicとの違い_試した内容スケールアウト_インについて_IPv6_dual_networkでの使い分けなど.pdf
cloudevcode
1
190
コスト削減から「セキュリティと利便性」を担うプラットフォームへ
sansantech
PRO
1
200
セキュリティ はじめの一歩
nikinusu
0
1.2k
Embedded SREの終わりを設計する 「なんとなく」から計画的な自立支援へ
sansantech
PRO
1
120
AIとともに歩む情報セキュリティ / Information Security with AI
kanny
4
2.8k
Featured
See All Featured
The Limits of Empathy - UXLibs8
cassininazir
1
210
Art, The Web, and Tiny UX
lynnandtonic
304
21k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
32
2.8k
Balancing Empowerment & Direction
lara
5
860
So, you think you're a good person
axbom
PRO
2
1.9k
How to optimise 3,500 product descriptions for ecommerce in one day using ChatGPT
katarinadahlin
PRO
0
3.4k
Product Roadmaps are Hard
iamctodd
PRO
55
12k
Lessons Learnt from Crawling 1000+ Websites
charlesmeaden
PRO
1
1.1k
Testing 201, or: Great Expectations
jmmastey
46
8k
Intergalactic Javascript Robots from Outer Space
tanoku
273
27k
BBQ
matthewcrist
89
10k
Jamie Indigo - Trashchat’s Guide to Black Boxes: Technical SEO Tactics for LLMs
techseoconnect
PRO
0
53
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();