[Haskell-cafe] Syntax proposal for "reverse apply"/"pipeline apply" (flip ($))
Alexey Muranov
alexey.muranov at gmail.com
Wed Apr 16 23:49:16 UTC 2014
On Thursday, April 17, 2014 1:38:48 AM UTC+2, Richard A. O'Keefe wrote:
>
> On 17/04/2014, at 10:25 AM, Alexey Muranov wrote:
> > For whatever it is worth, i would like to propose for discussion a
> syntax for "(flip ($))" operation in Haskell.
>
> Oh, you mean like F#'s "|>" operator?
>
> If we were to copy an operator from F#, it would have been
> nice to copy the F# name for it. Sadly, Data.Sequence
> already uses |> . Hoogle doesn't find a (|^), so that might
> work.
>
No, in fact i wanted to copy it from the exponential notation for function
application. In particular, it would need to be right-associative:
y |^ x |^ f == y |^ (x |^ f) == f x y
Maybe a left-associative version can be defined too, by something like this:
x ^| g ^| f == (x ^| (g |^ f) = f (g x)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20140416/84cea74e/attachment-0001.html>
More information about the Haskell-Cafe
mailing list