Example data matching code in Python and Haskell