[Haskell-cafe] Proposal: Infix expression keyword: -XInfixExpressions

Dan Burton danburton.email at gmail.com
Thu Feb 19 20:25:05 UTC 2015


I feel the same about this as I do about idiom brackets. I think
QuasiQuotes need more love. They are a little heavier syntactically, but
are flexible enough to accomplish the same thing.

blah = [ infixQ | (+) foo bar baz quux ]
blarg = [ idiomQ | pureFunc fa fb fc ]

Perhaps the extension that we should be proposing is to make QuasiQuotes
syntactically lighter.

{-# LANGUAGE QQLite #-}

blah = infixQ (+) foo bar baz quux
blarg = idiomQ pureFunc fa fb fc

Obviously some thought needs to be put into multiline/precedence/etc; I
don't think all QuasiQuoters would be suitable for usage in this way, but
Chris's existing ideas for his proposal seems to apply just as well to this
one.

(Also a bikeshedding comment: I think the keyword "infix" is not adequately
descriptive for this particular proposal. I'd prefer "vararg" or something
of the sort.)

-- Dan Burton

On Thu, Feb 19, 2015 at 6:51 AM, Christopher Done <chrisdone at gmail.com>
wrote:

> Ahoy,
>
> The idiom discussion brought back to mind a general problem (well, for
> me) in Haskell syntax which is there is no syntactic sugar for
> interspersing operators to many arguments.
>
> Regarding a solution for this, I wrote up a wee proposal here:
> https://gist.github.com/chrisdone/d9d33e4770a2fef19ad1
>
> If I go ahead and implement this in GHC as -XInfixExpressions or
> something (better names welcome), would it be likely to be accepted? I
> could first do an implementation in haskell-src-exts to demonstrate
> the concept.
>
> Ciao!
> _______________________________________________
> 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/20150219/085add50/attachment.html>


More information about the Haskell-Cafe mailing list