RE: GHC 6.4 release candidates available

Ah, yes. In 6.2, overlap errors were checked and reported "eagerly" at the instance declaration. So instance C Int a instance C b Bool was rejected. Now it isn't. Instead the program is only rejected if a constraint arises that matches two instance decls, and neither is more specific. For example (C Int Bool) But many constraints are fine e.g. C Int Char However this does have the consequence that the overlapping-instance flag must be on in the module that calls the function rather than the one that defines the instances. It'd be better if the info travelled with the instance decl, but it doesn't (yet). A good feature request. Simon | -----Original Message----- | From: glasgow-haskell-users-bounces@haskell.org [mailto:glasgow-haskell-users- | bounces@haskell.org] On Behalf Of Keean Schupke | Sent: 02 March 2005 17:20 | To: Simon Peyton-Jones | Cc: glasgow-haskell-users@haskell.org | Subject: Re: GHC 6.4 release candidates available | | In the past having: | | {-# OPTIONS -fallow-overlapping-instances #-} | | in a module was enough to get ghci to allow the overlaps. | | so we do: | | ghci Test.hs | | now it does not work (but it did in 6.3), but: | | ghci -fallow-overlapping-instances Test.hs | | does... Even it Test.hs is the top level module. | | Keean. | | Simon Peyton-Jones wrote: | | >Ralf | > | >You have a pragma "-fallow-overlapping-instances" in Test.hs, and indeed | >it is honoured when compiling Test.hs. But it's not taken into account | >when compiling top-level expressions, or, indeed, if you were to import | >Test into another module. | > | >If you say ":set -falllow-overlapping-instances" it'll work fine. | > | >Now, maybe you'd like the flag to attach permanently to the *instance*, | >so that if an instance decl is compiled with | >-fallow-overlapping-instances, then no complaint will ever be issued for | >its overlaps, even if it is imported into a module that doesn't have | >-fallow-overlapping-instances. That would make sense, I think, but it's | >not implemented and never has been. | > | >Simon | > | >| -----Original Message----- | >| From: glasgow-haskell-users-bounces@haskell.org | >[mailto:glasgow-haskell-users- | >| bounces@haskell.org] On Behalf Of Ralf Lammel | >| Sent: 02 March 2005 08:45 | >| To: glasgow-haskell-users@haskell.org | >| Subject: RE: GHC 6.4 release candidates available | >| | >| I think this is an old bug, | >| or at least I have seen it months back. | >| | >| The "overlapping instances" directive does not make it to the | >top-level. | >| See attached sample with the offending session. | >| | >| Thanks for fixing. | >| Ralf | > | >_______________________________________________ | >Glasgow-haskell-users mailing list | >Glasgow-haskell-users@haskell.org | >http://www.haskell.org/mailman/listinfo/glasgow-haskell-users | > | > | | _______________________________________________ | Glasgow-haskell-users mailing list | Glasgow-haskell-users@haskell.org | http://www.haskell.org/mailman/listinfo/glasgow-haskell-users

Erm, what is the module context of GHCi? I thought ghci used the context of the loaded module: ghci Test.hs *Test> I though the 'Test' in the prompt indicated you were in the context of the "Test" module. In which case the pragma at the top of the test module should be in force? Keean. Simon Peyton-Jones wrote:
Ah, yes. In 6.2, overlap errors were checked and reported "eagerly" at the instance declaration. So instance C Int a instance C b Bool was rejected. Now it isn't. Instead the program is only rejected if a constraint arises that matches two instance decls, and neither is more specific. For example (C Int Bool)
But many constraints are fine e.g. C Int Char
However this does have the consequence that the overlapping-instance flag must be on in the module that calls the function rather than the one that defines the instances. It'd be better if the info travelled with the instance decl, but it doesn't (yet). A good feature request.
Simon
| -----Original Message----- | From: glasgow-haskell-users-bounces@haskell.org [mailto:glasgow-haskell-users- | bounces@haskell.org] On Behalf Of Keean Schupke | Sent: 02 March 2005 17:20 | To: Simon Peyton-Jones | Cc: glasgow-haskell-users@haskell.org | Subject: Re: GHC 6.4 release candidates available | | In the past having: | | {-# OPTIONS -fallow-overlapping-instances #-} | | in a module was enough to get ghci to allow the overlaps. | | so we do: | | ghci Test.hs | | now it does not work (but it did in 6.3), but: | | ghci -fallow-overlapping-instances Test.hs | | does... Even it Test.hs is the top level module. | | Keean. | | Simon Peyton-Jones wrote: | | >Ralf | > | >You have a pragma "-fallow-overlapping-instances" in Test.hs, and indeed | >it is honoured when compiling Test.hs. But it's not taken into account | >when compiling top-level expressions, or, indeed, if you were to import | >Test into another module. | > | >If you say ":set -falllow-overlapping-instances" it'll work fine. | > | >Now, maybe you'd like the flag to attach permanently to the *instance*, | >so that if an instance decl is compiled with | >-fallow-overlapping-instances, then no complaint will ever be issued for | >its overlaps, even if it is imported into a module that doesn't have | >-fallow-overlapping-instances. That would make sense, I think, but it's | >not implemented and never has been. | > | >Simon | > | >| -----Original Message----- | >| From: glasgow-haskell-users-bounces@haskell.org | >[mailto:glasgow-haskell-users- | >| bounces@haskell.org] On Behalf Of Ralf Lammel | >| Sent: 02 March 2005 08:45 | >| To: glasgow-haskell-users@haskell.org | >| Subject: RE: GHC 6.4 release candidates available | >| | >| I think this is an old bug, | >| or at least I have seen it months back. | >| | >| The "overlapping instances" directive does not make it to the | >top-level. | >| See attached sample with the offending session. | >| | >| Thanks for fixing. | >| Ralf | > | >_______________________________________________ | >Glasgow-haskell-users mailing list | >Glasgow-haskell-users@haskell.org | >http://www.haskell.org/mailman/listinfo/glasgow-haskell-users | > | > | | _______________________________________________ | Glasgow-haskell-users mailing list | Glasgow-haskell-users@haskell.org | http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
participants (2)
-
Keean Schupke
-
Simon Peyton-Jones