

If you ever get tired of reading you can get the real source at the GitHub repo. This makes it so that it’s possible to simply copy & paste the text here into your favorite editor and run it, just make sure you save the file with a “.lhs” extension. Code lines prefixed with the “ >” character are actually part of the final program. This post is a published version of a Literate Haskell file. Since this post does not assume previous Haskell experience the beginning will be more of a Haskell tutorial and core concepts will be sectioned off to facilitate the learning process. This post assumes no previous knowledge with Haskell but it does assume moderate programming ability in another language, e.g. The goal is to give you a flavor of what a real program in Haskell looks like. This won’t be like a normal tutorial so you’ll probably have to do a bit of supplemental reading and practice afterward. To help that happen, this post will be in a semi-literate programming style and I’ll be describing a Dropbox API app written in Haskell. The steep learning curve forces you to understand what you are doing at a deeper level and you will be a better programmer because of it. They encourage you to model your data in coherent, concise, and elegant ways that feel right. In C# or Java, types can get in your way and even force you to write overly verbose code or follow silly “design patterns.” In Haskell, types help you soar to higher computational ground. Like a good Pythonista, I’m of the opinion that types are training wheels, but that’s really only until you use a language with a real type system.

Even though it was a bit rocky at first, I’ve grown to really love Python and the culture of fast iteration and duck typing.

While I’ve been at Dropbox, Python has been my main language of computational expression. I felt like I had massively improved as a programmer. After I wrote my first fold over a recursive algebraic datatype, I felt like I was finally starting to speak Haskell. I spent the next couple of weeks going through “ Yet Another Haskell Tutorial” and I remember it being incredibly difficult yet incredibly rewarding. Haskell? What’s that?Īfter reading more about Haskell, functional programming, lazy evaluation, and type inference and seeing the elegance of the various code samples, I was hooked. When I came upon the bzip2 homepage and consequently Julian Seward’s homepage I found a short note about Haskell and how it was a super fun and interesting language to write a compiler for. Reading and understanding open source projects was a main source of knowledge and inspiration for me when I was learning how to program. Like many people in those days, when I was in high school I spent a lot of time playing around with code on my computer.

My first encounter with Haskell started out about eight years ago.
