Greg said:
>To parade my ignorance... Something that's always puzzled me about Haskell
>is when to do something on the left and when on the right of a function
>definition. For example, there must be at least 4 ways of writing the factorial
>function: pattern match; guard; if ... then ... else ...; list comprehension
>+ fold
>
>I can appreciate that the declunkification transformation simplifies a
>common problem but the cost seems to be yet another way of writing a
>for loop... Are there any style guidelines for when to use what?
>
Style is a personal choice, surely. Most languages have several ways of
doing things. If there are too many heterogeneous bits of syntax for the
same concept we say the language is baroque, But in this case Simon is
actually advocating that two different bits of syntax be unified into one.
If this gives us new powers of expression, should we complain?
_____
/ /\
Tony Davie Computer Science / / \
Tel: +44 1334 463257 St.Andrews University / / \
Fax: +44 1334 463278 North Haugh / / /\ \
[EMAIL PROTECTED] St.Andrews / / / \ \
Scotland / / /\ \ \
KY16 9SS / / / \ \ \
/ /__/____\ \ \
/ \ \ \
http://www.dcs.st-and.ac.uk/~ad/Home.html /________________\ \ \
\ \ \
\_____________________\ /
In theory, there is no difference between theory and practice, but
in practice there is a great deal of difference.