ANNOUNCE: GHC 7.4.1 Release Candidate 1
Antoine Latter
aslatter at gmail.com
Fri Dec 23 23:58:26 CET 2011
One more code sample which compiled with GHC 7.2.1 and does not with the new RC:
>>>>>
{-# LANGUAGE FlexibleContexts, FlexibleInstances,
FunctionalDependencies, MultiParamTypeClasses, RankNTypes,
UndecidableInstances, TypeFamilies #-}
newtype MyMonadT m a = MyMonadT (m a)
class MyClass b m | m -> b where
data StM m :: * -> *
myFunc :: b a -> m a
instance MyClass b m => MyClass b (MyMonadT m) where
newtype StM (MyMonadT m) b = StMMine [b]
myFunc = undefined
<<<<<
In the instance, in GHC 7.2 the 'b' on the LHS of the newtype
introduces a fresh type binding. In the RC I get a kind error, because
the compiler seems to be trying to make all of the 'b' labeled types
the same type.
Since the 'b' isn't an indexing parameter, it doesn't make since for
it to not introduce a new binding.
This seems like an odd UI corner case, so I'm not sure what the
correct answer is. But it is a regression, so I thought I would ask
and make sure it was on purpose.
Antoine
More information about the Glasgow-haskell-users
mailing list