yet another version, Python to Haskell and back