infelicity in module imports
Thu, 12 Jul 2001 00:59:50 -0700
| Even with option 2, there is scope for confusion. "Import"=20
| without "qualified", imports both qualified and unqualified=20
| names, but adding the word "qualified" doesn't make any=20
| difference to the position of qualified names, but instead=20
| silently fails to import unqualified names.
| There is still a=20
| strange asymmetry, too. Whereas adding "qualified" to "import=20
| Modname ( a, b, c)" doesn't change which entities are=20
| imported, just the ability to refer to them by unqualified=20
| names, adding qualified" to "import Modname hiding ( a, b,=20
| c)" has the effect of importing everything that was previously hidden.
Not so. I hope the Report now unambiguously states that=20
import M hiding (a,b,c)
import qualified M hiding(a,b,c)
imports exactly the same entities (namely all that M exports
except a,b,c), only in the latter case only the qualified names are
brought into scope.
Can you suggest a way I could state it more clearly in the Report?
| Personally, I think the right solution is to import entire=20
| modules (the exported parts) qualified, and optionally to=20
| allow unqualified reference to some or all names, with a syntax like
| import modid [as modid] [unqualifying ( [all except]=20
| impspec] | all)
| but it's probably too late for this.