
On Jun 22, 2009, at 14:43 , Andrew Coppin wrote:
data Foobar a where Foo :: X -> Y -> Foobar NoZoo Bar :: X -> Y -> Foobar NoZoo Zoo :: Foobar NoZoo -> Foobar Zoo
For some reason, if I do this I get endless type check errors. I have to change the top two back to Foobar a before it will work. *sigh*
That's probably because ghc can't fix a type for Foobar a if you never actually use a anywhere. Functional dependencies could solve that, but giving ghc a way to infer a type for it by using it where it doesn't affect anything important is easier and doesn't risk possible(?) weird interactions between FDs and GADTs. -- brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allbery@kf8nh.com system administrator [openafs,heimdal,too many hats] allbery@ece.cmu.edu electrical and computer engineering, carnegie mellon university KF8NH