Code I have written while trying to learn Haskell