import prefers module in package over local module

Hello *, I am migrating a project from ghc 6.2 to ghc 6.4. This project has a module called Pretty and that's where my problems start. When importing Pretty, ghc does not consider my local definition but the Pretty module from the standard library (which is an alias for Text.PrettyPrint.HughesPJ). Is this behaviour intended or is it a bug? Can I change it? If it is intended, can somebody explain the rationale to me? BTW, I am using -hidir and -odir and the latest Debian package containing ghc 6.4.1. Thank you, Michael

Michael Marte wrote:
I am migrating a project from ghc 6.2 to ghc 6.4. This project has a module called Pretty and that's where my problems start. When importing Pretty, ghc does not consider my local definition but the Pretty module from the standard library (which is an alias for Text.PrettyPrint.HughesPJ). Is this behaviour intended or is it a bug? Can I change it? If it is intended, can somebody explain the rationale to me?
BTW, I am using -hidir and -odir and the latest Debian package containing ghc 6.4.1.
Thank you, Michael
This was the behaviour in 6.4, if I recall correctly, but it was fixed in 6.4.1. Are you definitely using 6.4.1? (you said 6.4 at the beginning of the message). Cheers, Simon

Simon, I checked the version of ghc I use: It's 6.4.1. Michael Simon Marlow wrote:
Michael Marte wrote:
I am migrating a project from ghc 6.2 to ghc 6.4. This project has a module called Pretty and that's where my problems start. When importing Pretty, ghc does not consider my local definition but the Pretty module from the standard library (which is an alias for Text.PrettyPrint.HughesPJ). Is this behaviour intended or is it a bug? Can I change it? If it is intended, can somebody explain the rationale to me?
BTW, I am using -hidir and -odir and the latest Debian package containing ghc 6.4.1.
Thank you, Michael
This was the behaviour in 6.4, if I recall correctly, but it was fixed in 6.4.1. Are you definitely using 6.4.1? (you said 6.4 at the beginning of the message).
Cheers, Simon

I'm afraid I don't understand: there's no Pretty module in the standard libraries, only Text.PrettyPrint. Could you describe in more detail what's going wrong? (provide example code and exact command lines, cut & paste error messages). Cheers, Simon Michael Marte wrote:
Simon,
I checked the version of ghc I use: It's 6.4.1.
Michael
Simon Marlow wrote:
Michael Marte wrote:
I am migrating a project from ghc 6.2 to ghc 6.4. This project has a module called Pretty and that's where my problems start. When importing Pretty, ghc does not consider my local definition but the Pretty module from the standard library (which is an alias for Text.PrettyPrint.HughesPJ). Is this behaviour intended or is it a bug? Can I change it? If it is intended, can somebody explain the rationale to me?
BTW, I am using -hidir and -odir and the latest Debian package containing ghc 6.4.1.
Thank you, Michael
This was the behaviour in 6.4, if I recall correctly, but it was fixed in 6.4.1. Are you definitely using 6.4.1? (you said 6.4 at the beginning of the message).
Cheers, Simon

On Wed, May 03, 2006 at 11:53:19AM +0100, Simon Marlow wrote:
I'm afraid I don't understand: there's no Pretty module in the standard libraries, only Text.PrettyPrint.
There is a Pretty module in the text package. It seems that Michael uses "ghc -package text". Best regards Tomasz

Tomasz Zielonka wrote:
On Wed, May 03, 2006 at 11:53:19AM +0100, Simon Marlow wrote:
I'm afraid I don't understand: there's no Pretty module in the standard libraries, only Text.PrettyPrint.
There is a Pretty module in the text package. It seems that Michael uses "ghc -package text".
Ok (text package is deprecated, of course). But still it seems to work for me: GHC 6.4.1 and later find the local Pretty before the text package one. Cheers, Simon

Simon Marlow wrote:
Tomasz Zielonka wrote:
On Wed, May 03, 2006 at 11:53:19AM +0100, Simon Marlow wrote:
I'm afraid I don't understand: there's no Pretty module in the standard libraries, only Text.PrettyPrint.
There is a Pretty module in the text package. It seems that Michael uses "ghc -package text".
Ok (text package is deprecated, of course). But still it seems to work for me: GHC 6.4.1 and later find the local Pretty before the text package one.
Cheers, Simon
In fact, I use -package text. But how come that this package is deprecated? There is a lot of stuff in it. Moreover, I never got a warning that it is deprecated. In contrast, I am being told that I should replace 'import Html' by 'import Text.Html', e.g. As to the fact, that you cannot reproduce my problem, two explanations come to mind: Either the Debian package does not really contain 6.4.1 or the problem arises from my specific combination of parameters, which I do not have at hand right now, unfortunately. Michael

On 03 May 2006 13:27, Michael Marte wrote:
Simon Marlow wrote:
Tomasz Zielonka wrote:
On Wed, May 03, 2006 at 11:53:19AM +0100, Simon Marlow wrote:
I'm afraid I don't understand: there's no Pretty module in the standard libraries, only Text.PrettyPrint.
There is a Pretty module in the text package. It seems that Michael uses "ghc -package text".
Ok (text package is deprecated, of course). But still it seems to work for me: GHC 6.4.1 and later find the local Pretty before the text package one.
Cheers, Simon
In fact, I use -package text. But how come that this package is deprecated? There is a lot of stuff in it. Moreover, I never got a warning that it is deprecated. In contrast, I am being told that I should replace 'import Html' by 'import Text.Html', e.g.
Deprecation warnings seem to be working fine: $ ghc -c Foo.hs -package text Foo.hs:2:0: Warning: Module `Pretty' is deprecated: This module has moved to Text.PrettyPrint.HughesPJ Also, the documentation for the text package clearly states in several places that the modules it contains are deprecated.
As to the fact, that you cannot reproduce my problem, two explanations come to mind: Either the Debian package does not really contain 6.4.1 or the problem arises from my specific combination of parameters, which I do not have at hand right now, unfortunately.
Ok, if you encounter the problem again in the future, please save the details and send them to us. Cheers, Simon

Simon Marlow wrote:
Deprecation warnings seem to be working fine:
$ ghc -c Foo.hs -package text
Foo.hs:2:0: Warning: Module `Pretty' is deprecated: This module has moved to Text.PrettyPrint.HughesPJ
Also, the documentation for the text package clearly states in several places that the modules it contains are deprecated.
I have got something wrong here: To use, say Text.Html or Text.PrettyPrint.HughesPJ, it is not necessary to use -package text on the command line? So module Pretty is in the package text and Text.Html is part of another package, maybe package base? So there is no need at all for the -package directive in my case? Michael

Michael Marte wrote:
Simon Marlow wrote:
Deprecation warnings seem to be working fine:
$ ghc -c Foo.hs -package text
Foo.hs:2:0: Warning: Module `Pretty' is deprecated: This module has moved to Text.PrettyPrint.HughesPJ
Also, the documentation for the text package clearly states in several places that the modules it contains are deprecated.
I have got something wrong here: To use, say Text.Html or Text.PrettyPrint.HughesPJ, it is not necessary to use -package text on the command line?
That's right.
So module Pretty is in the package text and Text.Html is part of another package, maybe package base?
Yes
So there is no need at all for the -package directive in my case?
Maybe not, but I haven't seen your code. Cheers, Simon
participants (4)
-
Michael Marte
-
Simon Marlow
-
Simon Marlow
-
Tomasz Zielonka