[Haskell-cafe] GHC Extension Proposal: ArgumentBlock

Edward Kmett ekmett at gmail.com
Tue Sep 8 14:54:09 UTC 2015


On Tue, Sep 8, 2015 at 10:10 AM, Michal Antkiewicz <
mantkiew at gsd.uwaterloo.ca> wrote:

> +1 for the change but not for an extension. Here's why
>
> 5. The only reason to guard changes behind LANGUAGE pragmas should be when
> they are causing problems with other extensions.
>

There is a massive downside to this view. It only permits monotonic
progress in one direction. If we later learn about a better thing we could
have done, you can never really retract it.

There are a lot of historically proposed extensions that 'don't break
anything' that you've never heard of that subtly conflict with other
extensions that 'don't break anything'.

Trex-records, half a dozen layout rule variants, I don't know how to
resolve both naked existential types in UHC and type families in GHC...

Each of these chip away at some innocuous corner of our syntax or
semantics, but in aggregate they'd leave us no room to grow, and no ability
to know if we'd written portable, standards compliant, code.

The LANGUAGE pragma is an annoying tax, but I think the long term benefits
in terms of readability of new extensions makes it worth it. Look at
languages like C++ and what horrible things they have to call everything to
avoid conflicting with every random historical idea baked into the
standard. Let's not go down that road.

You can always amortize the cost of those LANGUAGE pragmas by embedding
them in the extensions field of your cabal file if you feel they must be on
at all times in the code you write -- and since the ones you are interested
in are 'just extensions that don't break anything' this causes you no pain
when reading other people's code as they just don't use your favorite
extension.

-Edward

Best,
> Michał
>
> On Tue, Sep 8, 2015 at 12:56 AM, Andrew Gibiansky <
> andrew.gibiansky at gmail.com> wrote:
>
>> In order to get a feel for  using this extension in real-world Haskell,
>> take a look at the new ghc-reskin package:
>>
>> https://github.com/gibiansky/ghc-reskin
>>
>> This allows you to use ArgumentBlock *today* by passing GHC a few
>> parameters to tell it to use ghc-reskin as a preprocessor. Take a look at
>> the README for a full example.
>>
>> -- Andrew
>>
>> On Mon, Sep 7, 2015 at 9:02 PM, Bardur Arantsson <spam at scientician.net>
>> wrote:
>>
>>> On 09/08/2015 03:08 AM, Dan Burton wrote:
>>> > +1 people who like it can use it and people who don't like it don't
>>> have to
>>> > use it. Personally I wish it were the default because the superfluous $
>>> > confuses a lot of people coming from other languages like Ruby.
>>> >
>>>
>>> Whether it's "superfluous" depends entirely on one's PoV.
>>>
>>> > You can even write in the old style if you have the extension turned
>>> on. It
>>> > doesn't disable the old way of doing things. It just allows a new way.
>>> It's
>>> > entirely backwards compatible with working code when turned on, is it
>>> not?
>>> >
>>>
>>> Except now there are two "dialects" everybody has to read/understand.
>>> That's not progress IMO. (Considering that it's so little gain. I really
>>> don't understand the hatred of $ that some people seem to have.)
>>>
>>> Regards,
>>>
>>>
>>> _______________________________________________
>>> Haskell-Cafe mailing list
>>> Haskell-Cafe at haskell.org
>>> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
>>>
>>
>>
>> _______________________________________________
>> Haskell-Cafe mailing list
>> Haskell-Cafe at haskell.org
>> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
>>
>>
>
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20150908/cde1f691/attachment-0001.html>


More information about the Haskell-Cafe mailing list