Error message "Expecting a function type, but found `w_a1Kh'"
When compiling with GHC or loading into GHCi the following module I get a strange error:
module Bla where
bla :: String -> String
bla x = unwords $ [ ('#':) ]
The error is:
Bug.hs:4:20:
Expecting a function type, but found `w_a1bp'
Expected type: String
Inferred type: [Char] -> [Char]
In the expression: ('#' :)
In the list element: ('#' :)
Writing the function as:
bla = words [ ('#':) ]
produces the correct error message with [Char] instead of `w_a1bp'.
I was doing this with GHC-6.4.2 on Ubuntu with a 2.6.17 kernel.