Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Elm - The freedom of constraints

Sponsored · Ship Features Fearlessly Turn features on and off without deploys. Used by thousands of Ruby developers. →

Elm - The freedom of constraints

Avatar for Ilias Van Peer

Ilias Van Peer

September 23, 2017

Other Decks in Programming

Transcript

  1. Hi

  2. Elm • Functional Programming language for the frontend • More

    than a language • Delightfully opinionated • Incredible community
  3. - Evan Czaplicki What is the minimal thing we can

    get away with And how far can we go with that
  4. Virtual DOM Event R U N T I M E

    Model update Msg HTML
  5. R U N T I M E Model update Msg

    Sub Cmd • Listen on a web socket • Monitor the url (history API) • Incoming JS calls • … • Make an HTTP request • Change the url (history API) • Trigger outgoing JS calls • …
  6. Union types type RemoteData e a = NotAsked | Loading

    | Failure e | Success a krisajenkins/remotedata
  7. Records type alias Model = { firstName : String ,

    lastName : String , sidebarVisible : Bool , moreStuff : ... } viewUser : Model -> Html Msg viewUser model =
  8. Constraining records viewUser : { r | firstName : String

    , lastName : String } -> Html msg viewUser { firstName, lastName } = viewUser model =