Hello,

In Haskell, backquotes can be used to convert individual identifiers
into infix operators, but not complex expressions.  For example,

    [1,2,3] `zip` [4,5,6]

is OK, but not

    [1,2,3] `zipWith (+)` [4,5,6]

Is there any reason other than potential confusion when one of the two
backquotes is accidentally omitted?

In any case, perhaps some people on this mailing list would appreciate
the following implementation of "infix expressions" that Dylan Thurston
and I came up with -- as algebraic and perverse as we could manage:

    infixr 0 -:, :-
    data Infix f y = f :- y
    x -:f:- y = x `f` y

    main = print $ [1,2,3] -: zipWith (+) :- [4,5,6]

-- 
Edit this signature at http://www.digitas.harvard.edu/cgi-bin/ken/sig
The trick is that there is no trick.

Attachment: msg01848/pgp00000.pgp
Description: PGP signature

Reply via email to