This all seems to be solidifying nicely. From my perspective, I didn't really like the original proposal, but am now in favor of where it has evolved -- with all imports declared at the top, and then adding `import ...` to the syntax of local declarations. I'm not sure where the trouble around instances comes from in this idea, though. Even if a module is imported qualified, all of its instances are available anywhere, and I don't see that changing here. As Edward said, this would just be a small change in the renamer. Is it time to make a wiki page and post a feature request? I think so. Thanks! Richard On Aug 7, 2015, at 4:26 AM, Oliver Charles <ollie@ocharles.org.uk> wrote:
On Thu, Aug 6, 2015 at 6:19 AM Vlatko Basic <vlatko.basic@gmail.com> wrote: The old Turbo Pascal keyword "with" (used for records) popped up in my mind. It's rather clear for namespace resolution and would look something like this:
with Data.ByteString $ do map f ...
with Prelude $ do map f ...
or more explicit
withImport Data.ByteString $ do ....
One problem with this is that it forces an ordering on statements. Sometimes you might want to push the imports to the side, by moving them to a where clause, rather than a let binding. I'm hoping that whatever we propose would allow you to do this. That's why I think the syntax construct needs to be something that appears at the time of doing bindings.
ocharles _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe