[Haskell-beginners] Wrong type inferred for polymorphic function in a case alternative