[Haskell-cafe] Strange type error with associated type synonyms

Sittampalam, Ganesh ganesh.sittampalam at credit-suisse.com
Wed May 27 15:56:36 EDT 2009

Simon Peyton-Jones wrote:

> 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.) 

I'd suggest "is a type function and thus may not be injective" or
similar, otherwise people will think that type functions which are
injective according to the instances they've defined would be ok.



 Please access the attached hyperlink for an important electronic communications disclaimer: 

More information about the Haskell-Cafe mailing list