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
Connect.Tech 2017: Functional Web with Elm
Search
Jeremy Fairbank
September 20, 2017
Programming
0
180
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
190
CodeMash 2020: Solving the Boolean Identity Crisis
jfairbank
1
140
CodeMash 2020: Practical Functional Programming
jfairbank
1
310
Connect.Tech 2019: Practical Functional Programming
jfairbank
0
330
Connect.Tech 2019: Solving the Boolean Identity Crisis
jfairbank
0
170
Lambda Squared 2019: Solving the Boolean Identity Crisis
jfairbank
0
110
All Things Open 2018: Practical Functional Programming
jfairbank
2
250
Connect.Tech 2018: Effective React Testing
jfairbank
1
140
Fluent Conf 2018: Building web apps with Elm Tutorial
jfairbank
2
820
Other Decks in Programming
See All in Programming
ソフトウェアエンジニアの成長
masuda220
PRO
12
2.1k
『テスト書いた方が開発が早いじゃん』を解き明かす #phpcon_nagoya
o0h
PRO
9
2.5k
dbt Pythonモデルで実現するSnowflake活用術
trsnium
0
270
DevNexus - Create AI Infused Java Apps with LangChain4j
kdubois
0
120
クリーンアーキテクチャから見る依存の向きの大切さ
shimabox
5
1.1k
もう少しテストを書きたいんじゃ〜 #phpstudy
o0h
PRO
19
4.2k
15分で学ぶDuckDBの可愛い使い方 DuckDBの最近の更新
notrogue
3
800
ファインディLT_ポケモン対戦の定量的分析
fufufukakaka
0
940
ナレッジイネイブリングにAIを活用してみる ゆるSRE勉強会 #9
nealle
0
160
データの整合性を保つ非同期処理アーキテクチャパターン / Async Architecture Patterns
mokuo
55
19k
「個人開発マネタイズ大全」が教えてくれたこと
bani24884
1
280
PHPカンファレンス名古屋2025 タスク分解の試行錯誤〜レビュー負荷を下げるために〜
soichi
1
740
Featured
See All Featured
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
46
2.4k
The Invisible Side of Design
smashingmag
299
50k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
193
16k
The Power of CSS Pseudo Elements
geoffreycrofte
75
5.5k
The Cult of Friendly URLs
andyhume
78
6.2k
The Straight Up "How To Draw Better" Workshop
denniskardys
232
140k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
27
1.6k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
11
1.3k
The Language of Interfaces
destraynor
156
24k
The World Runs on Bad Software
bkeepers
PRO
67
11k
Bash Introduction
62gerente
611
210k
Scaling GitHub
holman
459
140k
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