<div dir="ltr">The main annoying thing in import lists for me at the moment is the proliferation of modules which one would like to import both qualified under some alias and to import a handful of names unqualified (especially infix functions and types). It would be nice if rather than <br><br>import qualified Data.Map as Map<br> import Data.Map (Map)<br> import qualified Data.Sequence as S<br> import Data.Sequence (Seq, ViewR(..), ViewL(..), (<|), (|>)) <br><br>we could instead have some variation like: <br><br>import Data.Map qualified as Map, (Map)<br> import Data.Sequence qualified as S, (Seq, ViewR(..), ViewL(..), (<|), (|>)) <br><br>I'm thinking something along the lines of the following:<br><br><i>impdecl</i> -> import <i>modid impspec_1, impspec_2, ..., impspec_</i>n (n >= 0)<br><i>impspec</i> -> ( <i>import</i>_1, ..., <i>import</i>_n [,] ) [<i>impqual</i>] (n >= 0)<div> |<span class="inbox-inbox-Apple-converted-space"> <i>impqual</i></span><div><i>impqual</i> -> [qualified] as <i>modid</i> [<i>imphiding</i>]</div><div> | <i>imphiding</i></div><div><i>imphiding</i> -> hiding (<i>import</i>_1, ...,<span class="inbox-inbox-inbox-inbox-Apple-converted-space"> </span><i>import</i>_n [,] ) (n >= 0)</div><div><br></div><div>I haven't thought particularly hard about this BNF, though hopefully it gets across my idea. You'd also certainly want to mix in support (perhaps with deprecation?) for the existing syntax which places the 'qualified' before the module identifier, even though I've personally always found that awkward, as it makes imports hard to read and sort.</div><div><br></div><div>The other thing which would greatly ameliorate the annoyance with import lists would be the ability to import and then re-export modules in a way that retains the manner in which things were qualified. So one could, if one wanted, have a module which imports things like Map, Set, (lazy and strict) Text, (lazy and strict) ByteString, etc. re-exported qualified the way one wants, and then import that from the other modules in the project.</div><div><i><br></i></div><div><div class="gmail_quote gmail_msg"><div dir="ltr" class="gmail_msg">On Wed, Feb 1, 2017, 10:36 Francesco Ariis <<a href="mailto:fa-ml@ariis.it" class="gmail_msg" target="_blank">fa-ml@ariis.it</a>> wrote:<br class="gmail_msg"></div><blockquote class="gmail_quote gmail_msg" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Wed, Feb 01, 2017 at 04:18:13PM +0200, Vassil Ognyanov Keremidchiev wrote:<br class="gmail_msg">
> Hello!<br class="gmail_msg">
><br class="gmail_msg">
> What do you think about an idea to have multiple imports on a single line,<br class="gmail_msg">
> like:<br class="gmail_msg">
><br class="gmail_msg">
> module MyApp where<br class="gmail_msg">
> import Data.Text, Data.Foldable, Control.Concurrent<br class="gmail_msg">
> ...<br class="gmail_msg">
<br class="gmail_msg">
Hello Vassil,<br class="gmail_msg">
how would qualified/as work?<br class="gmail_msg">
Would import statement like this:<br class="gmail_msg">
<br class="gmail_msg">
import Data.Text, qualified Data.Foldable as F, Control.Concurrent<br class="gmail_msg">
<br class="gmail_msg">
be allowed?<br class="gmail_msg">
<br class="gmail_msg">
_______________________________________________<br class="gmail_msg">
Haskell-prime mailing list<br class="gmail_msg">
<a href="mailto:Haskell-prime@haskell.org" class="gmail_msg" target="_blank">Haskell-prime@haskell.org</a><br class="gmail_msg">
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-prime" rel="noreferrer" class="gmail_msg" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-prime</a><br class="gmail_msg">
</blockquote></div></div></div></div>