Useful Haskell and Python snippets