From HaskellWiki

Mail info

The original header posted here:

From: dons@cse.unsw.edu.au (Donald Bruce Stewart) To: Simon Peyton-Jones <simonpj@microsoft.com> Date: Wed, 15 Mar 2006 23:25:34 +1100 Cc: haskell-prime@haskell.org, oleg@pobox.com Subject: Re: Infix expressions

This refered to a variety of articles, the original was said to be: haskell-cafe message

The solution

In Haskell we write `f` in order to infixify the identifier f. In ABC the stuff between backquotes is not limited to an identifier, but any expression may occur there. This would allow one to write e.g.

xs ` zipWith ( + )` ys

Chung-chieh Shan and Dylan Thurston showed the Haskell98 solution for exactly the same example, in their article `Infix expressions', back in 2002 in the article referenced above.

For ease of reference, here's their elegant solution:

infixr 0 -: , :- data Infix f y = f :- y x -: f :- y = x ` f ` y main = print $ [ 1 , 2 , 3 ] -: zipWith ( + ) :- [ 4 , 5 , 6 ]

For completeness, here's the `dual':