[Haskell-beginners] Is this a GHC bug? Problem inferring type