Elm began as an exploration of what “purely functional graphics programming” would look like, and has since grown into a practical language for front-end programming that is pure, functional, and statically-typed. This tutorial will cover the key concepts and features of Elm including declarative graphics, functional reactive programming, extensible records, and JavaScript interop. This will explain what “functional front-end programming” really means and how to do it in Elm.
We have three main conceptual objectives:
Understand FRP - core concepts and how to use them in practice
Understand the architecture of a functional GUI - structuring code, how the renderer works, useful patterns, etc.
Understand extensible records - explore the many tricks made possible by this Elm is designed so that it can be embedded in any app so you can introduce it incrementally, so by the end of this tutorial, you will be prepared to use Elm in your own project.
The target audience is commercial users who would like to use a functional approach on the front-end. Whether you are frustrated with JS or just exploring alternative approaches, you will get a lot out of this. It is also valuable for academics interested in seeing FP used to solve a very real practical problem.
This tutorial requires the Elm Platform, the elm-d3 source code, and a modern web browser. Documentation of the process can be found here: https://github.com/elm-lang/elm-platform/blob/master/README.md#elm-platform. The elm-d3 source code is available via GitHub: https://github.com/seliopou/elm-d3.
Evan Czaplicki is a functional programmer at heart, and his broad goal is to provide the tools and learning resources to make functional languages common in industry. He works full-time to develop Elm’s compiler, tools, and community to make it a great choice for web and cross-platform projects.
Spiros Eliopoulos is a research engineer at Cornell University, serving as Lead Engineer on the Frenetic controller platform for Software-Defined Networks. He’s the author of the elm-d3 library that provides Elm bindings to the D3 JavaScript library. Previously, he was the founding CEO of Tracelytics, a SaaS-based Application Performance Management company built on top of the X-Trace distributed tracing framework. He resides in Brooklyn, via Rhode Island.