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

Mike Ledger eleventynine at gmail.com
Wed Aug 5 12:59:54 UTC 2015


This would be really handy to have. You could also have import "blocks", 
like

import Foo in {
  ...
}

Where {...} is a new layout block, I guess.

On Wednesday, August 5, 2015 at 9:40:00 PM UTC+10, Oliver Charles wrote:
>
> On Wed, Aug 5, 2015 at 12:34 PM Yuras Shumovich <shumo... at gmail.com 
> <javascript:>> wrote:
>
>> > I find myself wanting to be able to say something like:
>> >
>> > foo = ...
>> >   where import Something.Specific
>>
>> Then GHC will need to parse all the source code in order to build
>> dependency tree. Also people may want to build dependency tree in their
>> minds too, it is easier with global imports (in the module header.)
>> What about the next:
>>
>> -- In the module header:
>> import qualified Something.Specific as Specific
>> ...
>> -- Somewhere else:
>> foo = ...
>>   where import Specific -- Note: importing by module alias
>>
>
> I would rather we are able to use exactly the same features as global 
> imports to reduce the cognitive burden of knowing what you can and can't 
> do. If those responsible for GHC tell me that what I want is unrealistic 
> then maybe we'll have to compromise, but right now I would rather not add 
> limitations.
>
> *ocharles*
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20150805/d8f6a1f4/attachment.html>


More information about the Haskell-Cafe mailing list