[Haskell] What makes a functional language functional?
O.Chitil at kent.ac.uk
Thu Aug 9 06:20:05 EDT 2007
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
>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.
More information about the Haskell