Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Speaker Deck
PRO
Sign in
Sign up for free
Connect.Tech 2017: Functional Web with Elm
Jeremy Fairbank
September 20, 2017
Programming
0
120
Connect.Tech 2017: Functional Web with Elm
Jeremy Fairbank
September 20, 2017
Tweet
Share
More Decks by Jeremy Fairbank
See All by Jeremy Fairbank
Connect.Tech 2020: Advanced Cypress Testing
jfairbank
1
100
CodeMash 2020: Solving the Boolean Identity Crisis
jfairbank
1
110
CodeMash 2020: Practical Functional Programming
jfairbank
1
270
Connect.Tech 2019: Practical Functional Programming
jfairbank
0
180
Connect.Tech 2019: Solving the Boolean Identity Crisis
jfairbank
0
130
Lambda Squared 2019: Solving the Boolean Identity Crisis
jfairbank
0
40
All Things Open 2018: Practical Functional Programming
jfairbank
2
210
Connect.Tech 2018: Effective React Testing
jfairbank
1
100
Fluent Conf 2018: Building web apps with Elm Tutorial
jfairbank
2
680
Other Decks in Programming
See All in Programming
Explore Java 17 and beyond
josepaumard
3
650
From Java 11 to 17 and beyond
josepaumard
0
300
バンドル最適化マニアクス at tfconf
mizchi
3
2.2k
TechFeed Conference 2022 - Kotlin Experimental
jmatsu
0
770
Reinventing the wheel ... as a service
mariofusco
3
260
Go API クライアントの実装 〜Go Conference に載せれなかったTIPS〜
yyoshiki41
0
190
インフラエンジニアの多様性と評価、またはキャリアへのつなげ方 / Careers as infrastructure engineers
katsuhisa91
0
510
TDX22: User-Mode DB Ops
ca_peterson
3
1.1k
Learning DDD輪読会#4 / Learning DDD Book Club #4
suzushin54
1
140
Blazor WebAssembly – Dynamische Formulare und Inhalte in Aktion
patrickjahr
0
160
C言語でメモリ管理を考えた話
hkawai
0
190
Licences open source : entre guerre de clochers et radicalité
pylapp
1
270
Featured
See All Featured
KATA
mclloyd
7
8.6k
Documentation Writing (for coders)
carmenhchung
48
2.5k
StorybookのUI Testing Handbookを読んだ
zakiyama
4
2k
Rails Girls Zürich Keynote
gr2m
86
12k
Clear Off the Table
cherdarchuk
79
280k
Building Adaptive Systems
keathley
25
1.1k
GraphQLとの向き合い方2022年版
quramy
16
8.1k
Gamification - CAS2011
davidbonilla
75
3.9k
Docker and Python
trallard
27
1.5k
How to name files
jennybc
39
58k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
350
21k
It's Worth the Effort
3n
172
25k
Transcript
Jeremy Fairbank @elpapapollo / jfairbank Functional Web with Elm Visit
README for demo and exercise URLs: https://github.com/jfairbank/elm-workshop
Software is broken. We are here to fix it. Say
hi@testdouble.com
Functional and statically typed programming language for frontend development elm
Web and UI Focused
Compiles to JavaScript
No runtime exceptions in practice.
The 2nd argument to function `add` is causing a mismatch.
7| add 2 "3" ^^^ Function `add` is expecting the 2nd argument to be: Int But it is: String Compile time static type checks
Functional
Pure Data in Data out
Pure No side effects
Pure Predictable and Testable!
Immutable Data • Safety and consistency • Explicit flow of
data • No subtle mutation bugs
No undefined is not a function
Fast
One framework. No fatigue. Update View Model Messages
✓ Easier to write code ✓ Easier to write tests
✓ Easier to refactor
Content • Functions and expressions • Lists, records, and immutability
• Static types and type aliases • Union types and pattern matching • Building Apps with the Elm Architecture
Format • Demos via ellie-app.com • Exercises via ellie-app.com •
Q&A
README for demo and exercise URLs: github.com/jfairbank/elm-workshop
Update View Model Messages The Elm Architecture
Application State Model
Model Virtual DOM View UI as a Function
elm Virtual DOM Todo List Learn Elm Build awesome Elm
apps Learn functional programming <html /> Model: Todo List
× Todo List Learn Elm Build awesome Elm apps Learn
functional programming User deletes first todo item <html /> Model: New Todo List
Todo List Learn Elm Build awesome Elm apps Learn functional
programming View Model: New Todo List Elm notices missing todo item in virtual DOM list, so it just removes the corresponding <li> instead of fully rendering. elm Virtual DOM ×<html />
Messages Standardized application events
elm app model
elm app model Events Text Input Mouse Click Associate message
with event
elm app model Events Text Input Mouse Click When event
triggers (i.e. user clicks), deliver message
Update Model New Model Respond to messages and create new
state
model Update View
model Update View
model Update View VDOM
model Update View VDOM
model Update View Select red color
model Update View Select red color
model Update View Select red color
model Update View
model Update View
model Update View
model Update View VDOM
model Update View VDOM
Demo and Exercise
Resources • elm-lang.org • elm-lang.org/examples • guide.elm-lang.org • www.elm-tutorial.org •
builtwithelm.co • Slack • elmlang.herokuapp.com
Thanks! Jeremy Fairbank @elpapapollo / jfairbank Slides: bit.ly/elm-connect