[Haskell-cafe] Syntax proposal for "reverse apply"/"pipeline apply" (flip ($))

Richard A. O'Keefe ok at cs.otago.ac.nz
Wed Apr 16 23:38:48 UTC 2014


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?

> (|>);;
val it : ('a -> ('a -> 'b) -> 'b) = <fun:it at 2>
> (<|);;
val it : (('a -> 'b) -> 'a -> 'b) = <fun:it at 3-1>

> I think that a good syntax would be "|^", for example:

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.

I will say, however, that whenever I've read chunks of F#
with long chains of |> operators, I've wanted to rewrite
them using point-free style.



More information about the Haskell-Cafe mailing list