[Haskell-cafe] Function Precedence

Hans Aberg haberg at math.su.se
Thu Apr 3 04:51:18 EDT 2008


On 3 Apr 2008, at 08:07, Henning Thielemann wrote:
>> Show could be implemented by writing out the function closures,  
>> but I think the reason it is not there is that it would create  
>> overhead in compiled code.
>
> It would also not give referential transparent answers, because the  
> same function can be implemented in different ways:
>   http://www.haskell.org/haskellwiki/Show_instance_for_functions

You can define scalars as constant functions, making the set of  
functions into a ring, and then implicit multiplication would not  
work. The way I view implicit multiplication though, is as an  
abbreviation of the explicit multiplication. So from that point of  
view, it is no stranger than other notational simplifications that  
may or may not take place, for example the use of parenthesizes.

So if one defines scalars as constants, one will have accept that  
implicit multiplication cannot take place. But that should not be a  
problem in Haskell, as it does not admit that anyway: one knows that x 
(y) always is function application.

Anyway, in math, the context may change. So sometimes it may be  
useful to let a number r denote a constant function, but if r is in a  
ring R, the it may be useful to let it denote the function that is  
multiplication of r.

Now in a computer language, the problem is to avoid setting one such  
possibility in stone at fundamental level so that by that it excludes  
the other variations.

   Hans




More information about the Haskell-Cafe mailing list