A Haskell Beginner's Experience With Yesod

I’ll start this post by listing my previous experience. I am a Ruby on Rails developer with 2 years experience with frontend and backend development. Before using Yesod I spent a few months learning the basics of Haskell from the book Learn You a Haskell for Great Good which has given me a great start on Haskell.

This is my experience after using Yesod for 3 months.

The best resource I found for getting started would be the Yesod book which covers much of the basics and a few of the more advanced things you will need. This book was fairly good for getting an understanding of how things work in Yesod. If the problem you want to solve is covered in the book you shouldn’t have too many issues getting it working.

The problems I encountered came from when I wanted to build my own website which with every feature I wanted to add almost always required the use of functions which were not explained in the book. The next resource I turned to was the documentation on hackage. This contained some info on all of the functions I needed, however not very much information. Mostly each function has the type signature and a one line description describing what it’s for. Haskell aficionados are probably reading this thinking “What else would you need” but as a beginner I found that working out how to use functions from just the types took me much much longer than when there was a usage example in the documentation.

I found myself spending most of my time trying to solve Couldn't match expected type issues and searching the yesod hackage pages for a function which I could add in to convert the types to solve those errors. This was hugely time consuming and not very fun at all. It was very exciting to see a function with a usage example meaning I would be able to jump right in and get to making stuff rather than reading the description for every single function in the module to see which ones fit together in which way.

This wasn’t limited to Yesod. Most of the Haskell packages I looked in to had little to no readme and no usage examples. While this is probably good enough for experienced Haskell users it made learning to use Haskell very difficult after leaving the well documented Prelude functions.

Apart from the difficulty to learn, Yesod seems like a very nice framework to build a website in. After working out how to use each piece it all makes sense and seems quite sane and very flexible. The Yesod.Test package had everything I needed and thankfully contained a decent amount of usage examples.

Another welcome surprise was the resource usage. While running Yesod on my develop machine I was pleased to see Yesod was only using a few MB of memory for my backend REST API.

Overall my experience using Yseod has been quite pleasant. My experience learning it, not so much. I would recommend Yesod to anyone wanting to explore the benefits of type safe functional web development however unless you are fairly confident in your Haskell skills I wouldn’t recommend Yesod for those who need to get something done quickly.