My attempt at the first Question in Haskell