djb's redo implementation in Haskell (for Haskell from Scratch video series)