[Haskell-cafe] Status of TypeDirectedNameResolution proposal?
simonpj at microsoft.com
Thu Nov 19 03:57:00 EST 2009
| The proposal has this sentence, apparently in reference to using
| qualified imports: "This is sufficient, but it is just sufficiently
| inconvenient that people don't use it much." Does this mean qualified
| One thing I'd really like that this would provide is shorter record
| selection. "b.color" is a lot nicer than "Button.btn_color b". Or
| would it? It seems like under a TDNR scheme to be able to write
| "b.color" I'd have to either import "color" explicitly or go over to
| the unqualified import world.
Good qn. I added a subsection "Qualified imports" to discuss.
| I don't really want to do the latter,
| but I also wouldn't want to maintain explicit import lists. Also, as
| far as I can see this doesn't provide is nice record update syntax.
| If I can write "b.color" I want to be able to write "b2 = b.color :=
Yes, well see "Record syntax". Might be doable.
| I think this will also lead to either lots of name shadowing warnings
| or more trouble picking variable names. The short perspicuous names
| this allows are also the most convenient for local variables. I don't
| want to suddenly not be able to use a 'color' variable name because
| some record has a 'color' field. A record system (and OO languages)
| would have no trouble with 'let color = b.color' but as far as I can
| see TDNR would have a problem.
Good point. I added a subsection "Top-level disambiguation only"
| So as far as records, TDNR doesn't seem too satisfactory.
I think these points are all addressable, more or less as OO languages do, as mentioned above.
Thanks for the suggestions
More information about the Haskell-Cafe