<div dir="ltr"><div class="gmail_quote"><div dir="ltr">On Wed, Aug 5, 2015 at 7:12 PM Tikhon Jelvis <<a href="mailto:tikhon@jelv.is">tikhon@jelv.is</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div><div><div>If you want a direct experience report, I've written a fair amount of OCaml which supports pretty much exactly this feature[1]:<br><br></div>    let open List in ...<br><br></div>They even have a weird concise version of the syntax:<br><br></div>    List.(...)<br><br></div>This is quite useful in practice, and doesn't seem to cause any problems. However, OCaml has different norms around external modules, so it might not translate to Haskell the same way.<br><br></div><div>In OCaml, every module is automatically imported qualified. There's no list of import statements at the top. Importing ("opening") a module is equivalent to an *unqualified* import in Haskell and happens rarely. Moreover, it can appear in any part of the file. In practice this doesn't seem to be a problem, but that could be because nobody's depending on having all the imports conveniently declared up-front. Personally, I think this trade-off is perfectly acceptable: I'd rather have life be better for programmers and worse for tools than vice-versa.<br><br></div><div>OCaml also doesn't have typeclasses or the open world assumption which would lead to confusing behavior one way or another.<br></div></div></blockquote><div><br></div><div>Thanks for providing another perspective! It's good to hear other languages are successfully employing this idea. </div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>With all that in mind, OCaml's feature feels closer to Elliot's suggestion: it's more about locally *dequalifying* a module than importing it. Doing just that also fits better with Haskell's current import and typeclass system. However, I'm not sure how to design a local dequalifying statement in a way that's not confusing. </div></div></blockquote><div><br></div><div>Indeed, having import stay at the top level to always bring type class instances in followed by the option of "opening" an import later is certainly more elegant and less hacky than what I'm proposing. I think this route will have to require a new keyword though, but we can establish those details later. I'm leaning more towards this idea now. Let's see what others think.<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe" rel="noreferrer" target="_blank"></a><br>
</div><div><br></div><div><i>ocharles</i></div></div></div>