Simple Type Inferencing exercise If you're wrestling with type inferencing, here's a function that provides a good simple example:
let f ordVal ch = ordVal == Data.Char.ord ch
As a first step, do :type Data.Char.ord. Given that type and the fact that Data.Char.ord ch is called, what type is inferred for ch? Then, given that ordVal is compared for equality to the result of Data.Char.ord ch, what type is inferred for ordVal? Check your answer with :type f. Try some calls to the function and create some partial applications, too. What computation is the function performing? What's a better name than f? :) Note that the fully qualified named Data.Char.ord is used to reference the ord function in the Data.Char module. If I'd done :m Data.Char first, I'd use just ord. Alternatively, if you wanted to load the code from a file, you'd use import Data.Char:
 % cat x.hs
import Data.Char
f ordVal ch = ordVal == ord ch  -- remember, no "let" when defining in a file