funny type inference error with ghc7.6rc1
simonpj at microsoft.com
Mon Aug 20 10:44:06 CEST 2012
That does seem odd. Can you give instructions for how to reproduce this? The fewer dependencies the better :-)
From: glasgow-haskell-users-bounces at haskell.org [mailto:glasgow-haskell-users-bounces at haskell.org] On Behalf Of Carter Schonwald
Sent: 17 August 2012 19:01
To: GHC Users List
Subject: funny type inference error with ghc7.6rc1
When playing with the current hackage versions of Epic and Idris to make them play nice with ghc7.6rc1
http://hackage.haskell.org/package/epic-0.9.3 (current version on github now builds on ghc 7.6, https://github.com/edwinb/EpiVM)
I ran into some funny type inference problems. Namely, using the idris-0.9.2.1 source and iteratively seeing how ghc complains,
I repeated found that ghc would infer extraneous class constraints with variables that don't appear in the function type!
eg (Num a, Ord a) => PArg -> Doc, when the correct type to infer would be PArg -> Doc.
heres some gists with links to more info
Anyways, I'm not sure what to make of this, is this a reasonable artifact of type inference getting confused on functions with a large number of case analyses when various typeclass extensions are enabled? Or Is this a bug in terms of what inference should be able to handle?
Just to be clear, when I add the infererred type ascriptions without the type class constraint, everything type checks in those modules. So my confusion is why the inference adding those unused class constraint variables!
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Glasgow-haskell-users