[Haskell-cafe] Syntax extension - adding import support to let/where bindings

Oliver Charles ollie at ocharles.org.uk
Fri Aug 7 08:26:54 UTC 2015


On Thu, Aug 6, 2015 at 6:19 AM Vlatko Basic <vlatko.basic at 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*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20150807/cf651d75/attachment.html>


More information about the Haskell-Cafe mailing list