<div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr">On Wed, Aug 5, 2015 at 5:43 PM Evan Laforge <<a href="mailto:qdunkan@gmail.com">qdunkan@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">> In practice I use a lot more than just two symbols. The point is the<br>
> repeated qualification quickly introduces more noise and obscures the intent<br>
> of the code.<br>
<br>
Well, qualification is only necessary for the symbols that conflict,<br>
right?  It seems to me that if you want an EDSL with a certain<br>
prelude, you have to make sure the prelude symbols are all distinct.<br>
If you want to compose two DSLs, then you could make a third prelude<br>
that imports the other two, but renames colliding symbols.<br></blockquote><div><br></div><div>At this point I am working for the compiler (and in this case doing a lot of work!), but it should be the other way round - this makes me sad.</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Unless there are many collisions... in which case, maybe don't define<br>
your EDSLs like that in the first place?<br></blockquote><div><br></div><div>My EDSLs for HTML and CSS are meant to reflect those actual languages as closely as possible. If I start renaming things just to "fit in" with other symbols, then I've started adding burden on my users. </div><div><br></div><div>Also, let's not forget this proposal is useful for more than just EDSLs, so lets not get too caught up on that - for example, one might wish to import Data.Text.Lazy or Data.Text in different locations depending on what they are working with. There are many packages out there with conflicting symbols that have fairly "localised" use sites, but at a granularity of a top-level definition rather than a module.</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Currently if you want to  figure out all imports you parse the top of<br>
the file and can stop at the first definition.  But with this feature<br>
you have to parse the whole file and thus understand all haskell<br>
grammar, including all extensions in use.  I'd have to give up on my<br>
fast deps chaser and switch to slow ghc -M... which is maybe the right<br>
way anyway, I don't know.<br>
<br>
Ok, to be fair, I wouldn't, because I could choose to not use that<br>
feature, but in *theory* :)  And while "you don't have to use it" is<br>
always brought up, it seems to me the more successful the feature is<br>
the more likely you do have to use it.<br></blockquote><div><br></div><div>It makes me sad if we can't progress the language on the grounds that people's attempts at parsing the source code themselves would break. If you want to know all the imports, then we should be providing this information through tools for people to consume. </div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On the other hand, lots of languages have a "local open" feature like<br>
this.  I think many of them make you first import the module, and then<br>
you can "open" it in a local scope.  This would address both my "parse<br>
the whole file for imports" objection and the "what about instances",<br>
because module importing would be unchanged.<br></blockquote><div><br></div><div>Indeed, this could be a path forward. I'm not really familiar with any languages that do this, could you link to some examples of how this works in other languages?</div><div><br></div><div><i>ocharles</i> </div></div></div>