[Haskell] What makes a functional language functional?

Olaf Chitil O.Chitil at kent.ac.uk
Thu Aug 9 06:20:05 EDT 2007


Chris,

I'm not sure what exactly your question is as you are mixing up several 
concepts. However, you start with:

>In haskell, we can transform:
>
>g x + f x
>
>into:
>
>f x + g x
>  
>
Here you assume that the function + is commutative. Although this is 
probably true for all numeric types in all Haskell implementations, 
neither functional languages in general nor the Haskell report guarantee 
commutativity of +. So this assumption is dangerous.

>0 + _|_ /= _|_ + 0
>
>Or, does this just become:
>
>_|_ = _|_ ?
>  
>
The Haskell report probably does not say so explicitly, but in general 
primitive functions like + are strict in all arguments and hence 0 + _|_ 
= _|_ = _|_ + 0.

Ciao,
Olaf



More information about the Haskell mailing list