Ticket #4008 (closed bug: invalid)
type error trying to specialize polymorphic function
|Reported by:||nr||Owned by:||simonpj|
|Component:||Compiler (Type checker)||Version:||6.12.1|
|Type of failure:||GHC rejects valid program||Difficulty:|
|Test Case:||Blocked By:|
The attached module won't compile---definition of 'wrap' is rejected. The error message is
[ 1 of 13] Compiling Pain ( Pain.hs, Pain.o ) Pain.hs:18:7: Couldn't match expected type `n C O' against inferred type `C' Expected type: ExTriple (Counter n) Inferred type: ExTriple (->) In the expression: scalar In the definition of `wrap': wrap = scalar
The inferred type is alarming, and in any case the type of wrap is a straightforward specialization of the type of scalar.
Could the problem be with liberal type synonyms? I don't think we're doing anything unreasonable...