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
55
Voice to guide "difficult" recycling queries
d6y
0
72
Brighton Java: Day in the life...
d6y
0
240
Day in the Life of a Functional Programmer
d6y
0
640
Exoplanet Safari
d6y
1
470
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
OCI技術資料 : 証明書サービス概要
ocise
1
7.2k
AIがコードを書く時代の ジェネレーティブプログラミング
polidog
PRO
3
370
Even G2 クイックスタートガイド(日本語版)
vrshinobi1
0
200
Oracle AI Database@Azure:サービス概要のご紹介
oracle4engineer
PRO
6
1.4k
仕様通り動くの先へ。Claude Codeで「使える」を検証する
gotalab555
8
2.3k
Strands Agents × Amazon Bedrock AgentCoreで パーソナルAIエージェントを作ろう
yokomachi
2
160
互換性のある(らしい)DBへの移行など考えるにあたってたいへんざっくり
sejima
PRO
0
550
組織的なAI活用を阻む 最大のハードルは コンテキストデザインだった
ixbox
1
610
AWS DevOps Agent or Kiro の使いどころを考える_20260402
masakiokuda
0
180
【関西電力KOI×VOLTMIND 生成AIハッカソン】空間AIブレイン ~⼤阪おばちゃんフィジカルAIに続く道~
tanakaseiya
0
160
Microsoft Fabricで考える非構造データのAI活用
ryomaru0825
0
650
GitHub Copilotを極める会 - 開発者のための活用術
findy_eventslides
4
2.3k
Featured
See All Featured
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
32
2.7k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
35
2.4k
Paper Plane
katiecoart
PRO
1
49k
BBQ
matthewcrist
89
10k
Navigating Team Friction
lara
192
16k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
25
1.8k
Deep Space Network (abreviated)
tonyrice
0
100
Learning to Love Humans: Emotional Interface Design
aarron
275
41k
ラッコキーワード サービス紹介資料
rakko
1
2.9M
Code Reviewing Like a Champion
maltzj
528
40k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.7k
The #1 spot is gone: here's how to win anyway
tamaranovitovic
2
1k
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();