From: simonpj Date: Tue, 6 May 2003 14:48:12 +0000 (+0000) Subject: [project @ 2003-05-06 14:48:12 by simonpj] X-Git-Tag: Approx_11550_changesets_converted~925 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=0773c6f70a7b46b243a6a47fe371fe1654a8e1b2;p=ghc-hetmet.git [project @ 2003-05-06 14:48:12 by simonpj] Note about context in data type decls --- diff --git a/ghc/docs/users_guide/bugs.sgml b/ghc/docs/users_guide/bugs.sgml index de507e9..60cadd5 100644 --- a/ghc/docs/users_guide/bugs.sgml +++ b/ghc/docs/users_guide/bugs.sgml @@ -283,6 +283,23 @@ main = print (array (1,1) [(1,2), (1,3)]) + GHC does not allow you to have a data type with a context + that mentions type variables that are not data type parameters. + For example: + + data C a b => T a = MkT a + + so that MkT's type is + + MkT :: forall a b. C a b => a -> T a + + In principle, with a suitable class declaration with a functional dependency, + it's possible that this type is not ambiguous; but GHC nevertheless rejects + it. The type variables mentioned in the context of the data type declaration must + be among the type parameters of the data type. + + + GHCi does not respect the default declaration in the module whose scope you are in. Instead, for expressions typed at the command line, you always get the