Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
My adventure with
SCORE 42
by Yan Cui
ELM
@theburningmonk
start of my ELM journey
things have
moved
on…
The Elm Architecture
remember Day 1?
state
Msg
update
init
new state
- every Erlang programmer
side-effects!
state
Msg
update
init
new state
Msg
state
Msg
update
init
subscriptions
Msg
new state
Msg
state
Msg
update
init
subscriptions
Msg
new state
view
Msg
state
Msg
update
init
subscriptions
Msg
new state
view
Msg
Msg
state
Msg
update
init
subscriptions
Msg
new state
view
Msg
Msg
@theburningmonk
x = { age=42, name=“foo” }
@theburningmonk
-- clone and update
y = { x | name = "bar" }
@theburningmonk
type alias Character =
{ age : Int, name : String }
@theburningmonk
type Tree =
| Leaf
| Branch Tree
@theburningmonk
Demo
8 segments
direction
change
change
no changenot allowed
direction
w
a s d
direction
direction
direction
direction
direction
cherry
direction
YUMYUMYUM!
direction
+1 segment
@theburningmonk
Demo
@theburningmonk
github.com/theburningmonk/elm-snake
@theburningmonk
elm-lang.org/try
@theburningmonk
guide.elm-lang.org
@theburningmonk
theburningmonk.com
github.com/theburningmonk
My adventure with Elm (polyconf 16)
My adventure with Elm (polyconf 16)
My adventure with Elm (polyconf 16)
My adventure with Elm (polyconf 16)
My adventure with Elm (polyconf 16)
My adventure with Elm (polyconf 16)
My adventure with Elm (polyconf 16)
My adventure with Elm (polyconf 16)
My adventure with Elm (polyconf 16)
My adventure with Elm (polyconf 16)
My adventure with Elm (polyconf 16)
My adventure with Elm (polyconf 16)
Upcoming SlideShare
Loading in …5
×

My adventure with Elm (polyconf 16)

4,353 views

Published on

In this talk I introduced Functional Reactive Programming and ELM and finished off with a live demo building a complete game of snake in Elm.
Code for the demo can be found at : https://github.com/theburningmonk/elm-snake

Published in: Technology
  • Be the first to comment

My adventure with Elm (polyconf 16)

  1. 1. My adventure with SCORE 42 by Yan Cui ELM
  2. 2. @theburningmonk
  3. 3. start of my ELM journey
  4. 4. things have moved on…
  5. 5. The Elm Architecture
  6. 6. remember Day 1?
  7. 7. state Msg update init new state
  8. 8. - every Erlang programmer
  9. 9. side-effects!
  10. 10. state Msg update init new state Msg
  11. 11. state Msg update init subscriptions Msg new state Msg
  12. 12. state Msg update init subscriptions Msg new state view Msg
  13. 13. state Msg update init subscriptions Msg new state view Msg Msg
  14. 14. state Msg update init subscriptions Msg new state view Msg Msg
  15. 15. @theburningmonk x = { age=42, name=“foo” }
  16. 16. @theburningmonk -- clone and update y = { x | name = "bar" }
  17. 17. @theburningmonk type alias Character = { age : Int, name : String }
  18. 18. @theburningmonk type Tree = | Leaf | Branch Tree
  19. 19. @theburningmonk Demo
  20. 20. 8 segments
  21. 21. direction
  22. 22. change change no changenot allowed direction w a s d
  23. 23. direction
  24. 24. direction
  25. 25. direction
  26. 26. direction
  27. 27. direction cherry
  28. 28. direction YUMYUMYUM!
  29. 29. direction +1 segment
  30. 30. @theburningmonk Demo
  31. 31. @theburningmonk github.com/theburningmonk/elm-snake
  32. 32. @theburningmonk elm-lang.org/try
  33. 33. @theburningmonk guide.elm-lang.org
  34. 34. @theburningmonk theburningmonk.com github.com/theburningmonk

×