[Haskell-cafe] Function Precedence

Hans Aberg haberg at math.su.se
Wed Apr 2 08:14:27 EDT 2008

On 2 Apr 2008, at 13:51, jerzy.karczmarczuk at info.unicaen.fr wrote:
>> But one should also be able to write (f+g)(x). - This does not  
>> work  in Haskell, because Num requires an instance of Eq and Show.
> So, declare them, even if they are vacuous. I did it several times,  
> I am
> still alive, so no need to say "this does not work".

That is possible, of course - I did that, too. But it means that the  
syntax and semantics do not work together; an invitation to pitfalls.  
So this ought to be avoided, except if there are no other workarounds.

It would be better to write a new Prelude. :-)


More information about the Haskell-Cafe mailing list