You need a statically typed pure functional programming language for web development.
The Elm Architecture is quite popular and its design has influenced the predictable state container Redux. The example code is rendering the user’s Markdown content to HTML and will demonstrate the typical Elm application structure with Model, View and Update.
- The Model is defining a record containing the application state.
- The View is a function taking the Model as input and returning HTML markup, representing the application state in a declarative way.
- The Update function receives the current Model and a Message and returns a new, updated Model.
The resulting application is a continuous loop. New user input results in a change message with content. The update function replaces the model content. The new model is passed to the view function and rendered to HTML using a Markdown library.