Example data munging code in Python and Haskell