
Hello Simon, Wednesday, May 27, 2009, 11:42:22 PM, you wrote: while we are here - i always had problems understanding what is inferred and what is expected type. may be problem is just that i'm not native speaker are other, especially beginners, had the same problem?
Claus made a suggestion about type error messages:
| Apart from bracketing fully applied type synonyms, the error message | could be improved by providing the missing bit of information about | 'Memo': | | D:\home\Haskell\tmp\desktop\types.hs:11:11: | Couldn't match expected type `Memo d1' | against inferred type `Memo d' | (type Memo d :: * -> *) | In the second argument of `(.)', namely `appl' | In the expression: abst . appl | In the definition of `f': f = abst . appl
I've implemented this idea; note the "NB" line below:
NoMatchErr.hs:20:11: Couldn't match expected type `Memo d' against inferred type `Memo d1' NB: `Memo' is a (non-injective) type function In the second argument of `(.)', namely `appl' In the expression: abst . appl In the definition of `f': f = abst . appl
(Rather than give its kind, I thought it was better to focus on the reason for the mis-match, namely the non-injectivity.)
Simon _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
-- Best regards, Bulat mailto:Bulat.Ziganshin@gmail.com