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
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
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
57
Voice to guide "difficult" recycling queries
d6y
0
76
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
生成AI時代に信頼性をどう保ち続けるか - Policy as Code の実践
akitok_
0
170
AIの揺らぎに“コシ”を与える階層化品質設計
ickx
0
270
世界の中心でApp Runnerを叫ぶ FINAL
tsukuboshi
0
250
試作とデモンストレーション / Prototyping and Demonstrations
ks91
PRO
0
200
知ってた?JavaScriptの"正しさ"を検証するテストが5万以上もあること(Test262)
riyaamemiya
1
170
「背中を見て育て」からの卒業 〜専門技術としてのテスト設計を軸に、品質保証のバトンを繋ぐ〜
nihonbuson
PRO
0
240
2026年春のAgentCoreアプデ 細かいやつ全部まとめ
minorun365
3
210
AI時代の品質はテストプロセスの作り直し #scrumniigata
kyonmm
PRO
4
1.4k
QAエンジニアはどうやって プロダクト議論の場に入れるのか?
moritamasami
2
410
「強制アップデート」か「チームの自律」か?エンタープライズが辿り着いたプラットフォームのハイブリッド運用/cloudnative-kaigi-hybrid-platform-operations
mhrtech
0
150
Shiny New Tools Won't Fix Your Problem
trishagee
1
120
The 7 pitfalls of AI
ufried
0
200
Featured
See All Featured
技術選定の審美眼(2025年版) / Understanding the Spiral of Technologies 2025 edition
twada
PRO
118
110k
From Legacy to Launchpad: Building Startup-Ready Communities
dugsong
0
200
Why Your Marketing Sucks and What You Can Do About It - Sophie Logan
marketingsoph
0
140
How to train your dragon (web standard)
notwaldorf
97
6.6k
Un-Boring Meetings
codingconduct
0
280
Stop Working from a Prison Cell
hatefulcrawdad
274
21k
Leadership Guide Workshop - DevTernity 2021
reverentgeek
1
280
The Illustrated Guide to Node.js - THAT Conference 2024
reverentgeek
1
340
Efficient Content Optimization with Google Search Console & Apps Script
katarinadahlin
PRO
1
540
Making Projects Easy
brettharned
120
6.6k
svc-hook: hooking system calls on ARM64 by binary rewriting
retrage
2
240
Beyond borders and beyond the search box: How to win the global "messy middle" with AI-driven SEO
davidcarrasco
3
120
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();