The Elm Architecture

is a simple Pattern for architecting webapps.

Animation by Lucamug post

The core idea is that your code is built around a Model of your application state, a way to update your model, and a way to view your model. github , page

> To learn more about this, read The Official Guide site and check out this section which is all about The Elm Architecture. This repo is a collection of all the examples in that section, so you can follow along and compile things on your computer as you read through. github

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 = ...

User input, like clicking a button or entering text, will call an update function, which updates the state and then is rendered back to a user with a view function. Instead of rendering HTML it is also possible to execute commands or Create Subscriptions. These methods can be used to make HTTP requests or listen for WebSocket messages.

~

Alex Berg, The Elm Architecture is the wrong abstraction for the web. page

* how to handle links and URLs