Haskell - web development

Has any of you tried creating a web application with Haskell? If so, what are the pros and cons of doing that?

I see that there are quite a lot of web frameworks for Haskell and I am curious of trying some of them. What was your experience with web development in Haskell like?

I tried setting up Yesod with Stack. Didn’t go too well: long time was spent waiting while it fetched and compiled the dependencies. Never got to actually build something with it.

However, the Yesod Book has IMO one of the best guide to Haskell’s common language pragmas (OverloadedStrings, TypeFamilies, TemplateHaskell, and QuasiQuotes) that is enough for practical understanding and use.

Snap seemed more lightweight and commonly used than Yesod (I believe Elm’s home page was built with Snap), but I remember getting an issue of outdated packages or something when trying to set it up with Stack.

I also have heard great things about Servant. I don’t think I’ve ever tried setting it up though.

So the conclusion of my Haskell web development experience: never got beyond setting one framework up :smile: Do note that I tried them all in 2016, so it’s fairly recent. Phoenix, Express.js, and Hapi.js was definitely a better experience on actually getting things done faster. Even I got further than that with Laravel.

1 Like

Sometimes it’s helpful to build on the experience of others :slight_smile:.

The in my opinion best lead after searching for “elm haskell web site” was:

Typed up CRUD SPA with Haskell and Elm

Servant is used. The only issue I see is the necessary conversion to Elm 0.18 in the first 5 parts.

PS: It should have been “elm haskell web application” - but I figured the use of Elm would rule out static websites that usually would be generated with something like Hakyll (which is used by the haskellbook.com website).

1 Like