Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
elm introduction at OK Lab Niederrhein
Search
Elmar Burke
July 13, 2016
Technology
170
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
elm introduction at OK Lab Niederrhein
Elmar Burke
July 13, 2016
Transcript
15 slides
ELM FUNCTIONAL PROGRAMMING IN YOUR BROWSER INTRODUCTION BY ELMAR BURKE
WHO AM I? Elmar Burke @elmarburke on mostly every network
[email protected]
I'M ONE OF THE PEOPLE AT ANGULARJS.DE We have articles
about AngularJS and Angular 2, a developer register and we give workshops!
EVERYTHING STARTS WITH A Hello World main = span [class
"welcome-message"] [text "Hello, World!"]
"THE HISTORY OF PROGRAMMING" AS SEEN FROM JAVASCRIPT 1. Assembly
2. C 3. Java 4. JavaScript
"THE HISTORY OF PROGRAMMING" AS SEEN FROM JAVASCRIPT 1. Assembly
- maintainability 2. C - memory management 3. Java - all those freakin' types 4. JavaScript - maintainability
WHAT'S THE NEXT LANGUAGE? > Types? > Functional? > Gradual
Types? > Prolog? > Stack-based?
None
WHAT MAKES ELM SO GREATE > No runtime exceptions >
Friendly Error Messages > Blazing fast rendering1 > Libraries with guarantees > Clean syntax > Smooth JavaScript interop 1 With the package elm-html
LETS BUILD SOMETHING WE'LL BUILD A SIMPLE COUNTER IN ELM
Go to elm-lang.org and grab the installer or head over to elm-lang.org/try
THE ELM ARCHITECTURE > Model — the state of your
application > Update — a way to update your state > View — a way to view your state as HTML
import Html exposing (..) -- MODEL type alias Model =
{ ... } -- UPDATE type Msg = Reset | ... update : Msg -> Model -> Model update msg model = case msg of Reset -> ... ... -- VIEW view : Model -> Html Msg view model = ...
import Html exposing (Html, button, div, text) import Html.App as
Html import Html.Events exposing (onClick) main = Html.beginnerProgram { model = 0, view = view, update = update } type Msg = Increment | Decrement update msg model = case msg of Increment -> model + 1 Decrement -> model - 1 view model = div [] [ button [ onClick Decrement ] [ text "-" ] , div [] [ text (toString model) ] , button [ onClick Increment ] [ text "+" ] ]
ADD A RESET BUTTON You'll need > A message >
An update > A button
ADD TYPES Types are optional. You can just add them.
More Decks by Elmar Burke
See All by Elmar Burke
Offene Daten Nutzen - OpenData-Talk beim OTS Learners Meetup Mai 2016
elmarburke
0
68
Europe - What are you?
elmarburke
0
81
Hoodie & offlineFirst @ NijmegenJS
elmarburke
0
490
Sketchnotes belongs to Talk https://speakerdeck.com/elmarburke/hoodie-and-offlinefirst-at-nijmegenjs
elmarburke
0
86
Other Decks in Technology
See All in Technology
IP重複は"ランディングVPC"で受け止める ― PrivateLink と Transit Gatewayによるマルチテナント接続基盤の設計
hatahata021
3
250
OpenTelemetryで変わった 新時代のCloudWatchメトリクス監視
tsukuboshi
0
470
AI対話型分析を作成し、リリースするまでの話 / The Road to Release: Buiding AI Conversational Analytics
yappli_developers
0
180
「任されビリティ」で引き受けて「よしなりてぃ」に頼らず任せる / Accept tasks with "makasarebility" and hand them over without relying on "yoshinarily"
pauli
1
860
目を覚ませ!僕らの認証情報が何者かに侵略されてるぞ
tkito
2
480
AI×アジャイルで、石橋を高速で叩きながら渡る~電力会社がゼロから築いた会員サイト改善プロセス~ / 20261112 Ayami Kanazawa & Shigeru Hirai
shift_evolve
PRO
1
110
そのイメージ、どのCIが作った? Artifact Attestationsで来歴を固定する / Which CI system created that image? Pinning provenance with Artifact Attestations
chmikata
0
140
E2E Test というハーネス — AI時代の自動テスト民主化
daishukojima
10
5.9k
認知負荷の減らし方 ~開発にも日常業務にも活かせるノウハウ~
minorun365
PRO
12
8.4k
Well, that’s weird…
csswizardry
1
130
20261113_AWS Organizations運用を下支えするCFn StackSetsの柔軟性
dkduppf
0
110
みん強Lightning! データ基盤ひとりでできるかな
endonanana
0
120
Featured
See All Featured
The Power of CSS Pseudo Elements
geoffreycrofte
82
6.6k
Practical Orchestrator
shlominoach
192
12k
WCS-LA-2024
lcolladotor
0
1k
Context Engineering - Making Every Token Count
addyosmani
9
1.3k
Conquering PDFs: document understanding beyond plain text
inesmontani
PRO
4
3.3k
Large-scale JavaScript Application Architecture
addyosmani
516
110k
Into the Great Unknown - MozCon
thekraken
41
2.8k
Speed Design
sergeychernyshev
33
2.2k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
659
62k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
35
2.6k
Ten Tips & Tricks for a 🌱 transition
stuffmc
1
290
Self-Hosted WebAssembly Runtime for Runtime-Neutral Checkpoint/Restore in Edge–Cloud Continuum
chikuwait
0
960