[Haskell-beginners] Having trouble defining type correctly