My adventure with Elm (polyconf 16)
-
Upload
yan-cui -
Category
Technology
-
view
2.996 -
download
0
Transcript of My adventure with Elm (polyconf 16)
![Page 1: My adventure with Elm (polyconf 16)](https://reader034.fdocuments.us/reader034/viewer/2022042723/587f25961a28ab350c8b7bc9/html5/thumbnails/1.jpg)
My adventure with
SCORE 42
by Yan Cui
ELM
![Page 2: My adventure with Elm (polyconf 16)](https://reader034.fdocuments.us/reader034/viewer/2022042723/587f25961a28ab350c8b7bc9/html5/thumbnails/2.jpg)
@theburningmonk
![Page 3: My adventure with Elm (polyconf 16)](https://reader034.fdocuments.us/reader034/viewer/2022042723/587f25961a28ab350c8b7bc9/html5/thumbnails/3.jpg)
start of my ELM journey
![Page 4: My adventure with Elm (polyconf 16)](https://reader034.fdocuments.us/reader034/viewer/2022042723/587f25961a28ab350c8b7bc9/html5/thumbnails/4.jpg)
things have
moved
on…
![Page 5: My adventure with Elm (polyconf 16)](https://reader034.fdocuments.us/reader034/viewer/2022042723/587f25961a28ab350c8b7bc9/html5/thumbnails/5.jpg)
The Elm Architecture
![Page 6: My adventure with Elm (polyconf 16)](https://reader034.fdocuments.us/reader034/viewer/2022042723/587f25961a28ab350c8b7bc9/html5/thumbnails/6.jpg)
remember Day 1?
![Page 7: My adventure with Elm (polyconf 16)](https://reader034.fdocuments.us/reader034/viewer/2022042723/587f25961a28ab350c8b7bc9/html5/thumbnails/7.jpg)
![Page 8: My adventure with Elm (polyconf 16)](https://reader034.fdocuments.us/reader034/viewer/2022042723/587f25961a28ab350c8b7bc9/html5/thumbnails/8.jpg)
![Page 9: My adventure with Elm (polyconf 16)](https://reader034.fdocuments.us/reader034/viewer/2022042723/587f25961a28ab350c8b7bc9/html5/thumbnails/9.jpg)
![Page 10: My adventure with Elm (polyconf 16)](https://reader034.fdocuments.us/reader034/viewer/2022042723/587f25961a28ab350c8b7bc9/html5/thumbnails/10.jpg)
![Page 11: My adventure with Elm (polyconf 16)](https://reader034.fdocuments.us/reader034/viewer/2022042723/587f25961a28ab350c8b7bc9/html5/thumbnails/11.jpg)
![Page 12: My adventure with Elm (polyconf 16)](https://reader034.fdocuments.us/reader034/viewer/2022042723/587f25961a28ab350c8b7bc9/html5/thumbnails/12.jpg)
![Page 13: My adventure with Elm (polyconf 16)](https://reader034.fdocuments.us/reader034/viewer/2022042723/587f25961a28ab350c8b7bc9/html5/thumbnails/13.jpg)
state
Msg
update
init
new state
![Page 14: My adventure with Elm (polyconf 16)](https://reader034.fdocuments.us/reader034/viewer/2022042723/587f25961a28ab350c8b7bc9/html5/thumbnails/14.jpg)
- every Erlang programmer
![Page 15: My adventure with Elm (polyconf 16)](https://reader034.fdocuments.us/reader034/viewer/2022042723/587f25961a28ab350c8b7bc9/html5/thumbnails/15.jpg)
side-effects!
![Page 16: My adventure with Elm (polyconf 16)](https://reader034.fdocuments.us/reader034/viewer/2022042723/587f25961a28ab350c8b7bc9/html5/thumbnails/16.jpg)
state
Msg
update
init
new state
Msg
![Page 17: My adventure with Elm (polyconf 16)](https://reader034.fdocuments.us/reader034/viewer/2022042723/587f25961a28ab350c8b7bc9/html5/thumbnails/17.jpg)
![Page 18: My adventure with Elm (polyconf 16)](https://reader034.fdocuments.us/reader034/viewer/2022042723/587f25961a28ab350c8b7bc9/html5/thumbnails/18.jpg)
state
Msg
update
init
subscriptions
Msgnew state
Msg
![Page 19: My adventure with Elm (polyconf 16)](https://reader034.fdocuments.us/reader034/viewer/2022042723/587f25961a28ab350c8b7bc9/html5/thumbnails/19.jpg)
![Page 20: My adventure with Elm (polyconf 16)](https://reader034.fdocuments.us/reader034/viewer/2022042723/587f25961a28ab350c8b7bc9/html5/thumbnails/20.jpg)
state
Msg
update
init
subscriptions
Msgnew state
view
Msg
![Page 21: My adventure with Elm (polyconf 16)](https://reader034.fdocuments.us/reader034/viewer/2022042723/587f25961a28ab350c8b7bc9/html5/thumbnails/21.jpg)
![Page 22: My adventure with Elm (polyconf 16)](https://reader034.fdocuments.us/reader034/viewer/2022042723/587f25961a28ab350c8b7bc9/html5/thumbnails/22.jpg)
state
Msg
update
init
subscriptions
Msgnew state
view
Msg
Msg
![Page 23: My adventure with Elm (polyconf 16)](https://reader034.fdocuments.us/reader034/viewer/2022042723/587f25961a28ab350c8b7bc9/html5/thumbnails/23.jpg)
![Page 24: My adventure with Elm (polyconf 16)](https://reader034.fdocuments.us/reader034/viewer/2022042723/587f25961a28ab350c8b7bc9/html5/thumbnails/24.jpg)
state
Msg
update
init
subscriptions
Msgnew state
view
Msg
Msg
![Page 25: My adventure with Elm (polyconf 16)](https://reader034.fdocuments.us/reader034/viewer/2022042723/587f25961a28ab350c8b7bc9/html5/thumbnails/25.jpg)
![Page 26: My adventure with Elm (polyconf 16)](https://reader034.fdocuments.us/reader034/viewer/2022042723/587f25961a28ab350c8b7bc9/html5/thumbnails/26.jpg)
@theburningmonk
x = { age=42, name=“foo” }
![Page 27: My adventure with Elm (polyconf 16)](https://reader034.fdocuments.us/reader034/viewer/2022042723/587f25961a28ab350c8b7bc9/html5/thumbnails/27.jpg)
@theburningmonk
-- clone and updatey = { x | name = "bar" }
![Page 28: My adventure with Elm (polyconf 16)](https://reader034.fdocuments.us/reader034/viewer/2022042723/587f25961a28ab350c8b7bc9/html5/thumbnails/28.jpg)
@theburningmonk
type alias Character = { age : Int, name : String }
![Page 29: My adventure with Elm (polyconf 16)](https://reader034.fdocuments.us/reader034/viewer/2022042723/587f25961a28ab350c8b7bc9/html5/thumbnails/29.jpg)
@theburningmonk
type Tree = | Leaf| Branch Tree
![Page 30: My adventure with Elm (polyconf 16)](https://reader034.fdocuments.us/reader034/viewer/2022042723/587f25961a28ab350c8b7bc9/html5/thumbnails/30.jpg)
@theburningmonk
Demo
![Page 31: My adventure with Elm (polyconf 16)](https://reader034.fdocuments.us/reader034/viewer/2022042723/587f25961a28ab350c8b7bc9/html5/thumbnails/31.jpg)
![Page 32: My adventure with Elm (polyconf 16)](https://reader034.fdocuments.us/reader034/viewer/2022042723/587f25961a28ab350c8b7bc9/html5/thumbnails/32.jpg)
8 segments
![Page 33: My adventure with Elm (polyconf 16)](https://reader034.fdocuments.us/reader034/viewer/2022042723/587f25961a28ab350c8b7bc9/html5/thumbnails/33.jpg)
direction
![Page 34: My adventure with Elm (polyconf 16)](https://reader034.fdocuments.us/reader034/viewer/2022042723/587f25961a28ab350c8b7bc9/html5/thumbnails/34.jpg)
change
changeno changenot allowed
directionw
a s d
![Page 35: My adventure with Elm (polyconf 16)](https://reader034.fdocuments.us/reader034/viewer/2022042723/587f25961a28ab350c8b7bc9/html5/thumbnails/35.jpg)
direction
![Page 36: My adventure with Elm (polyconf 16)](https://reader034.fdocuments.us/reader034/viewer/2022042723/587f25961a28ab350c8b7bc9/html5/thumbnails/36.jpg)
direction
![Page 37: My adventure with Elm (polyconf 16)](https://reader034.fdocuments.us/reader034/viewer/2022042723/587f25961a28ab350c8b7bc9/html5/thumbnails/37.jpg)
direction
![Page 38: My adventure with Elm (polyconf 16)](https://reader034.fdocuments.us/reader034/viewer/2022042723/587f25961a28ab350c8b7bc9/html5/thumbnails/38.jpg)
direction
![Page 39: My adventure with Elm (polyconf 16)](https://reader034.fdocuments.us/reader034/viewer/2022042723/587f25961a28ab350c8b7bc9/html5/thumbnails/39.jpg)
direction
cherry
![Page 40: My adventure with Elm (polyconf 16)](https://reader034.fdocuments.us/reader034/viewer/2022042723/587f25961a28ab350c8b7bc9/html5/thumbnails/40.jpg)
direction
YUM YUM YUM!
![Page 41: My adventure with Elm (polyconf 16)](https://reader034.fdocuments.us/reader034/viewer/2022042723/587f25961a28ab350c8b7bc9/html5/thumbnails/41.jpg)
direction
+1 segment
![Page 42: My adventure with Elm (polyconf 16)](https://reader034.fdocuments.us/reader034/viewer/2022042723/587f25961a28ab350c8b7bc9/html5/thumbnails/42.jpg)
@theburningmonk
Demo
![Page 46: My adventure with Elm (polyconf 16)](https://reader034.fdocuments.us/reader034/viewer/2022042723/587f25961a28ab350c8b7bc9/html5/thumbnails/46.jpg)
@theburningmonktheburningmonk.comgithub.com/theburningmonk