After reading a few books on Haskell I had to face the reality: learning by doing a project was necessary!
I chose a project which was easy enough to be finished in a few weeks or months (but still slightly challenging) and had a practical utility.
If you don’t know what Lens are, think of them as getters/setters/filters/functions combinators similar to JQuery or CSS selectors but for any type of data-structures. I’m still a beginner regarding Lens.
The challenge for me was to learn how to dynamically evaluate Haskell expressions. This is uncommon since Haskell is statically typed. The library I used to do that is naturally limited in its functionality in comparison to a Lisp but the final result is all but disappointing.
For the purpose of my program I implemented a pretty printer for JSON similar to aeson-pretty but with colors. Maybe I should package it for Hackage?
Once I had hdevtools setup for cabal sandboxes, programming in Haskell
was enjoyable. Refactoring is easy thanks to the strong type system. I
was stuck once or twice with the type system but the people on the
#haskell channel were helpful. The code has a certain form of esthetic
even if I feel more knowledge would allow me to be cleaner. For
example I wonder if it is possible to avoid pattern matching on
Right for multiple calls which return something like
x y), since both
Either are monads.
You can have a look at the project here: