[Haskell-cafe] Proposal: Shorter Import Syntax
amos.robinson at gmail.com
Fri Jun 5 06:04:04 UTC 2015
I have little to add, except I agree with Richard and Malcolm: this just
seems like a confusing hack to me.
On Fri, 5 Jun 2015 at 15:53 Malcolm Wallace <malcolm.wallace at me.com> wrote:
> I agree with everything Richard says here. Not only is the proposed
> syntax bad, but I don't see any good motivation for the general idea of
> making minor tweaks to the imports section. I don't find it at all
> annoying to use a couple of lines to be completely explicit about which
> names are always qualified, which are optionally qualified, and the
> qualifier to use; and indeed I am a heavy user of the 'as' form, both with
> and without 'qualified'.
> I think there is a burden on the proposer to demonstrate a decent
> power-to-weight ratio for the change, and saving a few characters at the
> expense of introducing considerable confusion just does not seem right to
> me. "The new syntax does not let us do anything we cannot do now." On the
> other hand, I could imagine a different import system altogether being
> attractive, perhaps a higher-order one like ML modules, although someone
> would have to flesh out the details.
> > On 5 Jun 2015, at 05:23, "Richard A. O'Keefe" <ok at cs.otago.ac.nz> wrote:
> >> On 4/06/2015, at 5:15 am, Anthony Cowley <acowley at seas.upenn.edu>
> >> The idea is that rather than writing,
> >> import Data.Map (Map)
> >> import qualified Data.Map as M
> >> you could instead write,
> >> import Data.Map (Map) as M
> > This puts the list (Map) in the wrong place.
> > You know how in English, "heavy" parts of a sentence go at the end?
> > The "heavy" part of an import declaration is the impspec.
> >> The Map identifier would imported unqualified, while M would be
> >> introduced as an alias for the qualified import of Data.Map.
> > I find that confusing. I expected it to mean that
> > only Data.Map.Map would be available and that it would
> > have to be referred to as M.Map. The core problem is
> > that this is a bit too close to English syntax, where
> > the placement of "as M" after (Map) suggests that it
> > refers to (Map), rather than to Data.Map.
> > The new syntax does not let us do anything we cannot do now.
> > It is also asking too much to ask people to distinguish
> > between
> > import Full as Local (thingy) -- current
> > import Full (thingy) as Local -- proposed
> > Whatever its faults, the current scheme at least makes
> > it obvious that 'as Local' refers to 'Full', not '(thingy)'.
> > _______________________________________________
> > Haskell-Cafe mailing list
> > Haskell-Cafe at haskell.org
> > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Haskell-Cafe