Elm Introduction
Intro
What is Elm?
Why ?
HELLO!
My name is Godefroid
@gotcha
@__gotcha
Goals:
Avoid:
Agenda:
What is Elm ?
Javascript
Elm
npm
Webpack
Built in
Built in
React
Redux
Built in
Built in
Typescript/Flow
Immutable.js
Built in
Built in
“Redux evolves the ideas of Flux, but avoids its complexity by taking cues from Elm.”
Source: http://redux.js.org/
Side note:
“Unbreakable” &
“Functional”
What do we mean
when we say breakable?
Broken.
“The sky is Uncaught TypeError: Cannot read property 'color' of null at <anonymous>:1:5”
Wrong?
“The sky is green.”
Functional Style
Functional Language
Functional features
Imperative features
Functional features
Compromises
Here FP practices require discipline
Here FP practices are the default
OKAY
Let’s code!
Code Time
Basic +/- counter
←
←
←
←
←
←
←
←
We define values
We write functions
Elm does the rest!
Update
View
Msg
Model
View
State
Update
View
Model
Html
New!
Update
Msg
Model
Model
New!
Html.beginnerProgram
We define values
We write functions
Elm does the rest!
View
Update
Elm Runtime
Browser
Msg
Model
Model
Model
Html
DOM
Event!
Model
New!
Update
View
Msg
Model
Msg
Msg
Html.program
We define values
We write functions
Elm does the rest!
View
Update
Elm Runtime
Browser
Msg
Msg
Model
Model
Model
Html
DOM
Event!
Model
New!
Effects
Cmd
Cmd
Msg
Update
View
Msg
Model
Html.program
We define values
We write functions
Elm does the rest!
View
Update
Elm Runtime
Browser
Msg
Model
Model
Model
Html
DOM
Model
New!
Effects
Cmd
Cmd
Msg
Event!
Msg
Update
View
Msg
Model
Update
Msg
Model
Model
New!
Cmd
Pls do these things!
Next:
Awesome things!
Next:
Best pair-programming buddy ever
Refactoring:
Nice canned scenarios
Refactoring:
Worse scenario
Next:
Elm packages
Auto-semvar
Next:
Compiling Elm
app.js
Elm Compiler
*.elm
Compiling
.js
*.elm
*.js
webpack
elm-webpack-loader
Webpack loader for the Elm programming language
Next:
How do I use Elm
at work?
With react-elm-components
With plain javascript
Next:
Caveats
Thoughts
Further reading/watching
Thanks Mario!
CREDITS: Arvirargus theme by SlidesCarnival
Those slides were prepared by��Mario Rogic