Christoph Herrmann wrote:

>>>>>> "Gabor" == Gabor Greif <[EMAIL PROTECTED]> writes:
>
>    Gabor> I am wondering if it would be feasible to declare laws that
>    Gabor> are guaranteed to hold for some objects in a Haskell-like
>    Gabor> functional language.
>
>I think that's such an important point that extensions of the
>language are appropriate.
>
>    Gabor> For example I would like to declare that (+) is
>    Gabor> commutative. This would have the benefit, that the compiler
>    Gabor> could optimize the parameter passing to a commutative
>    Gabor> function by not having to swap arguments on the stack:
>
>Not to forget associativity! This would allow a compiler
>to parallelize the fold and scan functions which could have
>a great impact on the execution time.
>

OK but one would have to be VERY careful here as many hardware models of
the numbers (especially floats) are NOT associative.


Tony Davie, Computer Science, St.Andrews University, North Haugh, St.Andrews
Scotland, KY16 9SS,      Tel: +44 1334 463257,          Fax: +44 1334
463278
mailto:[EMAIL PROTECTED]  Home:  http://www.dcs.st-and.ac.uk/~ad/Home.html
Handel Index and Chronology:
http://bruichladdich.dcs.st-and.ac.uk/HandelWWW/HandelCat.html
Limerick Archive:
http://bruichladdich.dcs.st-and.ac.uk/LimericksDir/Limericks.html



Reply via email to