For the complete documentation index, see llms.txt. This page is also available as Markdown.

Elmish

Elmish is an F# implementation of the Elm Architecture (also known as MVU — Model-View-Update). It structures UI logic around basic concepts:

  • Model: immutable state, generally a record

  • Messages (Msg): discriminated union of possible events

  • update: function that produces a new model and optional side effects (Cmd)

  • view: pure function that renders the model and dispatches messages

Benefits:

  • This unidirectional data flow makes state changes predictable and easy to reason about.

  • The update function is straightforward to unit test (setting Cmd values aside).

  • Even though commands can trigger asynchronous operations (API calls, timers, etc.), our application code remains entirely synchronous — async orchestration is handled at a higher level by the Elmish runtime.

In the F# ecosystem, Elmish is provided by the Fable.Elmish library and integrates with React through Feliz.

Last updated