Contributing to Haskell OSS

There is a huge amount of quality libraries available on Hackage, written by really smart people. Lately I've set myself an informal challenge to read and understand how more of them work.

Follow the types, learn the tools

If you're at the very beginning of your Haskell journey, it may be daunting to start looking through production code. But when you're ready, it's invaluable to pick up idioms and patterns by reading prior art. The first time I'm trying to figure out how something works I might use hasktags and just jump around the source, trying to map out what's going on. In contrast to untyped environments, in Haskell you can always tell "what something is" by reading type annotations or using :t in ghci. If I'm getting lost in some gnarly statements, typed holes are an incredible feature. They tell you: "what the compiler is expecting, and what bindings might be useful".

Use the things

If you take a library and try and do something non-trivial in it, you'll likely find surprising things, things you wish were different, or things you think could be documented or explained better. These are great opportunities to contribute back. Recently I was using Yesod in a project, and discovered that it wasn't escaping JavaScript. This flew under the radar because normally Yesod will pack scripts into external files (instead of inline with HTML) where escaping matters less. It was fun to engage with the maintainers to work out a solution, working out how that component was put together, and contributing a small fix. I would never have discovered this caveat if I hadn't been trying to use Yesod in a slightly different way.

Don't get discouraged

Haskellers love to share complicated ideas through Haskell, and it's a great medium for learning about things like Category Theory and Abstract algebra. Sometimes it can be discouraging to struggle hard with a concept everyone seems to be blogging about. In the words of bitemyapp:

Don't sweat the stuff you don't understand immediately. Keep moving!