In this Haskell program,
@@ is an infix operator that I want to define only locally within the body of function
f. (Naturally enough, my actual program is more complicated than this, and there is a good reason to use infix notation.)
infixl 5 @@ (@@) = undefined f x = x @@ 5 where x @@ y = (x+1) * (y+1) main = print (f 7)
However, unless I also make the global definition, written here as
(@@) = undefined, GHC complains that 'The fixity signature for
@@ lacks an accompanying binding.' Is there any way of getting round this without a global definition of the operator symbol?