Servant is a library for building web services in Haskell. It lets you fully specify your web service’s API as a type, which allows for some pretty cool stuff like documentation and client code generation.

Elm is a typed, functional, compile-to-Javascript language for the browser. Using libraries like start-app and elm-html and by following The Elm Architecture, it’s super simple to create well-architected, dynamic, maintainable web apps.

Servant-Elm is a Haskell library that can save you some typing by generating Elm code to query your Servant API. But more than that, it extends that beautiful type-safety you’re used to having in the Haskell and Elm worlds across the interface between the two. When you change the API and forget to update the frontend, your friend the compiler will let you know.

Let’s get stuck in.

We’ll be using Stack 1.0.2 and Elm 0.16.

Project layout

We’ll start a new project using the default stack template.

stack new servant-elm-books --resolver lts-5.2

More to follow soon.