On Mon, 27 Mar 2000, George Russell wrote:
> We've had numerous suggestions to add things to Haskell. However in
> my opinion many more computer languages (and programs) are ruined by
> too many features, than by too few.
I agree with the principle. My conservatism could be seen several times on
the list (overlapping instances, reflection; don't remember all).
But I don't agree with your particular choices of things to remove.
> (1) The Prelude. If you want a program to print out "2+2", you should have
> to import "IO" and a numeric library, say "Integers".
Why don't remove Prelude:
(A) Almost all programs use integers, strings, I/O, equality, and some
lists. It's inconvenient to begin *every* module with a technical
fixed set of imports, which distract from the code that is important.
(B) Some Prelude things (and some non-Prelude too) are hard-wired into the
syntax. What should list syntax mean when I don't import the Prelude?
What about integer and string literals?
> (c) if as a user I want my own definition of "+" (say I want an Int +
> that (doesn't) signal overflow), I am stuck.
You are not. You can import Prelude qualified and define your own "+".
(Every code that wants to use your code will have to import Prelude
qualified as well or qualify usages of "+" - which is good.)
> (2) Get rid of the do { ; ; ; } notation and force people to use indentation.
> Or vice-versa.
I don't agree, because:
- Most of the time indentation is more readable.
- When not, it's *really* inconvenient to use indentation. For example in
automatically generated code.
Simply both have their uses, although technically they are redundant.
Sometimes I use ; instead of a newline together with indentation.
Indentation should not force line breaks, which can make code less
readable when things separated by ;'s are very short.
The only problematic thing is the requirement to implicitly close }
when a parse error is encountered. It would be simpler and convenient
enough to specify characters before which to put } when they are not
balanced, like ")" "]" "," "|".
> To make indentation less dangerous, any leading blank characters apart from
> plain old simple " " (that means you, TAB) should cause the program to be
> rejected.
My editor puts TABs and I am happy with it. I could dig into it and see
how to let it put spaces only in Haskell files, but please don't force me
to do it.
> (3) $. I would rather people wore out their ( and ) keys a little more,
> and tried a little less to impress me with the brevity of their code.
I don't agree. Sometimes there is very short modifier at the beginning
(like unsafePerformIO, or when <condition>) followed by argument spanning
many indented lines. Parentheses should not be too far from each other.
I hate LISP syntax. More than 4 parentheses in a row is too much.
> (4) If a datatype is declared as having field labels it should not also
> allow access by providing the field entries in the same order as the
> datatype. Two primitive ways of access to the same type don't go.
For a type with two fields (e.g. line and column) record patterns are too
verbose, however it's convenient to have extractor functions or to change
the column only using record update syntax.
IMHO record selectors should be remade with ".", but that's another
story...
--
Marcin 'Qrczak' Kowalczyk