Adding type declarations to the haskell functions.