[Haskell-cafe] Syntax proposal for "reverse apply"/"pipeline apply" (flip ($))
t at tmh.cc
Wed Apr 16 23:43:45 UTC 2014
lens defines & for this purpose (not that one would want to pull in the
behemoth that is lens as a dependency just for that).
On Wed, Apr 16, 2014 at 3:25 PM, Alexey Muranov <alexey.muranov at gmail.com>wrote:
> i am completely new to Haskell, but i am somewhat fascinated by
> lambda-calculus and programming.
> For whatever it is worth, i would like to propose for discussion a syntax
> for "(flip ($))" operation in Haskell.
> I think that a good syntax would be "|^", for example:
> square x = x * x
> y = 3 |^ square -- y == 9
> * i would have suggested just ^, but it would conflict with number
> * it is rather common in mathematics to write function application in
> exponential notation: x ^ f instead of f(x), especially if f is an
> automorphism of some structure,
> * (flip ($)) is exactly the exponentiation of Church numerals,
> * in "The calculi of lambda-conversion", Alonzo Church uses the
> "shorthand" notation "[N^M]" for "(MN)", where M and N are lambda-terms.
> * I am probably not the only person missing the ability to apply functions
> from the right:
> Well, other notations i've thought of are "\^" and "~$".
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Haskell-Cafe