[Haskell-cafe] Proposal: Shorter Import Syntax
spam at scientician.net
Thu Jun 4 20:23:26 UTC 2015
On 06/04/2015 08:14 PM, Anthony Cowley wrote:
> Sorry, Yuras! I wanted to make sure the dissenting voices were heard.
> The current vote count is ~28-4. It seems like we're on the precipice
> of a fatal bike shedding, so I'm counting all the votes for keeping
> "quantified" as negative (as that's what Richard stated for himself),
> and trying to be conservative counting the +1's. I hope that's enough
> of a majority.
> To put things in perspective again, the Stackage package set has 10x
> as many qualified imports as unqualified imports that use the "as"
> keyword. The point here is to slightly smooth things out for the 10-1
> majority case.
> While I do appreciate that these two lines can potentially be mistaken
> for each other,
> import Map as M (fromList)
> import Map (fromList) as M
> I think the movement of the explicit import group is quite visibly
> striking, and, as previously noted, you could misread the former every
> time and only misunderstand 0.3% of import statements you read.
> Preserving the "qualified" keyword is better than no change at all,
> but is, I think, gratuitous preservation of a minor wart. Given the
> support for the original proposal, I'd hate to snatch defeat from the
> jaws of victory here.
(I thought I'd posted this earlier, but I guess not from my news
reader's idea of concensus reality as decided by GMANE.org.)
+1 to whatever syntax is decided upon as long as it doesn't break too
much existing code (i.e. published/Hackage code). Down with bikeshedding
for its own sake! :)
That said, I agree with "qualified" being a bit annoying, but overall I
think I've come around to the viewpoint that gradual evolution is
probably better in this specific case -- at some point (maybe the year
20x5) it might be the case that everyone is using the new syntax and old
syntax could be dropped over a few deprecation cycles. Ideally, that's
what *should* happen if the change is compelling enough!
More information about the Haskell-Cafe