Lars Lillo Ulvestad
Lars Lillo Ulvestad
Developer and digital storyteller. Works as a front-end developer at Kantega.

Series: IHP with Elm

Make widgets for your IHP/Haskell app with Elm.
Published: Tuesday, 15 December 2020
Less than one minute
Article cover photo

IHP is a refreshing modern Haskell MVC framework. It's simple to get started with, in contrast to how Haskell is often perceived. It's popularly called "Haskell on Rails". The good old multi page app (MPA) is back and better than ever.

Elm is a delightful language for writing reliable web apps. And even if it's most famous for writing single page apps (SPA), it's just as great for sprinkling interactivity on the MPA architecture.

Elm and IHP is a satisfying combo to work with for great SSR support, unlimited possibilities for interactivity and the simplicity of pure functions all over.

A simplified version of Richard Feldman's RealWorld SPA archtecture turns out to be well suited for a widget-engine in IHP.

This tutorial series about the "Elm-as-widget" pattern, combines two of the world's sweetest programming languages into one great developer experience.

Table of contents

1. How to setup IHP with Elm

2. How to initialize data from IHP directly to Elm

3. Structure Elm into a multi-widget app for IHP

4. Make http requests from Elm to IHP

Git Repo

The complete code is available on Github:

Got a comment? Drop me a tweet