Suggested type signature causes a type error (even though it appears correct)
|Reported by:||tvynr||Owned by:|
|Component:||Compiler (Type checker)||Version:||7.4.1|
|Keywords:||type signature typeclass instance forall||Cc:||zep_haskell_trac@…, rpglover64|
|Operating System:||Linux||Architecture:||x86_64 (amd64)|
|Type of failure:||GHC rejects valid program||Test Case:|
|Related Tickets:||Differential Revisions:|
The attached file, MWE.hs, contains an experiment attempting a rudimentary encoding of extensible ASTs in Haskell (without using compdata or a similar package relying upon OverlappingInstances and so forth). The definition of the upcast function appears to be correct. Compiling without a type signature produces a warning and the suggestion to include a type signature. Including the suggested type signature (which appears to be the correct one) causes a type error.