Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

To put a more positive spin on this, I'd be interested if someone could point to a practical, in use, open source project written in Haskell that I could learn from please?

All the tutorials and theory make sense, but making the jump to what I can do with other languages still seems a big one.



I'm a relative newbie when it comes to Haskell; I've found it's best to just get stuck in - pick a project and just go for it. Especially if you're doing real-world stuff, because you'll just get sick to your back teeth of yet another fibonacci tutorial. Once you get stuck-in you'll find yourself on the Hackage docs site a lot, click on the Source link on the top right of every page, you'll find gold in there.

A real world thing I did this week (which unfortunately is proprietary so I can't share), was a distributed configuration system for our cluster. It uses the RabbitMQ library[1][2] and Acid-state library[3] to have a per-node config-DB and uses RabbitMQ's guarantees for delivery of updates to the nodes. Messages are serialised using Aeson[4], the Haskell JSON library. I implemented a vector-clock versioning system on top of the Acid-state store to allow the clients to do conflict resolution. It really was a joy to write (around 350 lines of code). The C# client less so, 1000s of lines of boilerplate.

I think there's something really impressive about haskell; I tend to have significantly more trust in the code I write because mostly I know the edge cases don't exist. 9 times out of 10 if your code compiles it will work. Although be prepared for the compiler to hate you when you first start. The beatings are worth it though.

There's some basic code samples in the links:

[1] https://github.com/hreinhardt/amqp

[2] http://videlalvaro.github.io/2010/09/haskell-and-rabbitmq.ht...

[3] http://acid-state.seize.it

[4] https://github.com/bos/aeson


Pandoc, which I linked above fits into your question nicely. And because you specifically asked about something to learn from: there are some well made Youtube videos which explain some of the code in pandoc and xmonad: https://www.youtube.com/watch?v=FEFETKhhq8w


Wow - that video was brilliant, thanks for the recommendation. (Subscribed to Jekor's channel)





Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: