There are a lot of interesting haskell snippets to be found online. This post could be found under this (awesome) Stack Overflow question. The author writes the following: