Hi, The following class declaration worked in GHC 6.4. I recently upgraded to 6.6 (following Debian), and now it is broken. class Error e => Game b mv e | b -> mv e where newBoard :: MonadState b m => m () ... Since MonadState has the fundep m -> b, the type of newBoard fully specifies all of the class parameters. And this worked fine in GHC 6.4. But GHC 6.6 complains: The class method `newBoard' mentions none of the type variables of the class Game b mv e When checking the class method: newBoard :: m () In the class declaration for `Game' Any ideas? Thanks, Yitz
On 11/12/06, I wrote:
The following class declaration worked in GHC 6.4. I recently upgraded to 6.6 (following Debian), and now it is broken.
class Error e => Game b mv e | b -> mv e where newBoard :: MonadState b m => m () ...
Hmm, following up on Simon Peyton-Jones' recent announcement of an overhaul of GHC's type inference machinery, and reviewing the Haskell-Prime ticket on fundeps, I see that this is not so simple. I commend the work that is being done on this important topic. I hope it will be possible to get fundeps that will work well with monad transformers and their various type classes. For that, we will need fundeps that allow at least some simple resolution back through class context restraints on functions, instances, and classes. (Or some suitable alternative.) In the meantime, perhaps the -fallow-undecidable-instances flag should have a similar effect for fundeps. Or maybe there should be a separate flag for fundeps. Is this possible? Thanks, Yitz
participants (1)
-
Yitzchak Gale