Some haskell code that I need to reference from time to time