teo's redo implementation in haskell (for haskell from Scratch video series)