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

Oliver Charles ollie at ocharles.org.uk
Wed Aug 5 14:15:43 UTC 2015


On Wed, Aug 5, 2015 at 3:12 PM Moritz Kiefer <moritz.kiefer at gmail.com>
wrote:

> Am Mittwoch, 5. August 2015 14:59:54 UTC+2 schrieb Mike Ledger:
>>
>> 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.
>>
>  Is *let* not exactly this block feature?
>

Indeed, in my post I use let bindings to achieve this:

let import CSS in [ width (px 50) ]

You could also add other local bindings to your scope:

let import CSS
    sizeInPx = px 50
in [ width sizePx, height sizeInPx ]

(Note that just like let the other bindings have access to the symbols that
were imported)

*ocharles*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20150805/8da54798/attachment.html>


More information about the Haskell-Cafe mailing list