[Haskell-cafe] Why does Haskell have the if-then-else syntax?

David House dmhouse at gmail.com
Thu Jul 27 13:52:07 EDT 2006


On 27/07/06, Brian Hulley <brianh at metamilk.com> wrote:
> I'd be in favour of /if /case /let /\ etc instead of fi esac tel because it
> looks more systematic and follows the usual XML conventions for end tags.
> I'd suggest that floating point division should just be written `divide` -
> it's just a very specialised arithmetic op so why waste a nice symbol on it?
> (ditto ^ ^^ **) (I'd have thought integer division is used more often and
> no-one seems to mind writing `div`.)

Why I'd oppose this:

1. Decreases readability/clarity (brackets group things so much clearer)
2. No obvious benefits over brackets (just as many keystrokes, if not more)
3. Not at all backwards-compatible.

I'd support your ideas to change the if syntax, if they weren't
backwards-incompatible. I think something as basic as if statements
can't really be changed now. It will always be a blot on the otherwise
lovely Haskell syntax.

-- 
-David House, dmhouse at gmail.com


More information about the Haskell-Cafe mailing list