[Haskell-cafe] Syntax proposal for "reverse apply"/"pipeline apply" (flip ($))
Alexey Muranov
alexey.muranov at gmail.com
Thu Apr 17 12:58:20 UTC 2014
On 17 avr. 2014, at 14:35, Alexander Berntsen <alexander at plaimi.net> wrote:
> In my opinion we should just have '|>' and '<|' from F#. They are much
> nicer, being mnemonics for direction. And '|>' is just orders of
> magnitude nicer than 'flip ($)'. But alas, I fear we are stuck with
> this wart.
Then i think symmetric aliases for '(.)' and 'flip (.)' would also be needed. Still this would not make the language completely symmetric because it is impossible:
* 'f x' would still be 'f x',
* a left-associative and a right-associative operator symbols cannot have the same precedence, so '|>' and '<|' would need to have different precedence.
Maybe just some naming convention is needed for the names of the flips of commongly flipped operators? I am thinking about something silly like '~$', '~.', or '-$', '-.', or maybe some other unary operator symbol can be used sefely as a prefix here...
Alexey.
More information about the Haskell-Cafe
mailing list