Re: + and -: syntax wars!

1993-05-27 Thread Kent Karlsson


Oops, PreludeCore cannot be hidden.  I guess I've made a fool of myself
(but that happens often :-).

 Can't we find anything more interesting to discuss that the syntax??
You are welcome to! :-)   But sweeping syntax matters under the carpet
does not improve anything. 


 |  ... But what I find a bit strange is that even when + and -
 | are overridden locally n+k and prefix - still have their old meanings.
 | Well, it's just one more exception to the rule to remember about Haskell.
 Yes, but we need to emphasize that rebinding such operators is a Bad Idea.
 (Maybe Phil is right, that we should simply forbid it.)

   I agree that it should be forbidden, not for the love of prohibitions,
but in order to detect more errors in programs statically, and to avoid
some quite unnecessary ways to muddle a Haskell program.  But there are
several degrees to which rebinding could be forbidden. Here are some
of the alternatives (sorry if you find this confusing/confused :-):

1. Forbidding rebinding + and -.
2. Forbidding rebinding operators/function names exported from
   classes in PreludeCore.
(Except in instance declarations, of course.)
3. Forbidding rebinding operators/function names declared by
   classes in scope.
(Except...)
4. Forbidding rebinding any name exported by PreludeCore.
5. Forbidding rebinding any name in scope.

I don't like singling out +, -, and PreludeCore more than necessary, so
alternative 3 (plus remark below) or 5 are good candidates in my opinion.

   I still think that Lennarts quiz declaration should be illegal at least on the
grounds Paul gave (i.e., even if the name (+) is replaced by some other name):
Names bound by the "lhs"es (in each let/where declaration part)
should not be allowed to be rebound by some argument pattern
within one of the "funlhs"es in the declaration. 


Syntactically confused
/kent k




Re: + and -: syntax wars!

1993-05-26 Thread Joe Fasel


John Peterson
  Lennart Augustsson
Joe Fasel

|  This whole issue regarding redefinition of + and - is getting confused
|  unnecessarily.  Both of these are in PreludeCore and cannot be renamed
|  or hidden.  Because of this their fixities cannot be changed.  It is
|  possible to locally shadow + and - but this cannot change their
|  fixities and has no effect on + in n+k patterns.
| Exactly!  But what I find a bit strange is that even when + and -
| are overridden locally n+k and prefix - still have their old meanings.
| Well, it's just one more exception to the rule to remember about Haskell.

Yes, but we need to emphasize that rebinding such operators is a Bad Idea.
(Maybe Phil is right, that we should simply forbid it.)  What you want
to do instead is provide a Num (in this case) instance.  If you complain
that your funny + and - don't have the right types to be part of a Num
instance, I have no sympathy.  ("Pathetic, ruddy planet---I've no sympathy
at all.")

--Joe




Re: Oh no - not more SYNTAX wars! (was: operators)

1992-01-29 Thread haskell-request

Original-Via: uk.ac.nsf; Wed, 29 Jan 92 15:14:28 GMT

   John Peterson writes:

   I was planning to stand aside on syntax issues, but this is going too far!
   
   Simon proposes:
   the back-quote stuff in the lexical syntax,
   and the paren-ifying in the ordinary syntax.
   [...]
   Me:
   Oh no!  Not more syntactic convolution!
   
I agree with John, only more so.  I'd rather do without the proposed
1.2 gratuitous complexification, too.  What was wrong w/ the good old
friendly *lexemes*...?

var `var`
+   (+)

It never occurred to me to confuse the lexeme (+) with the syntactic
whatsit (+ ...).  Nor have I seen a Haskell program(mer) bitten by
this alleged shortcoming.

Can anyone provide an example of a *single real* Haskell program that
would benefit from the post-1.0 changes?

Will "Feeling Better, Too" Partain




Oh no - not more syntax wars! (was: operators)

1992-01-23 Thread haskell-request

Original-Via: uk.ac.nsf; Fri, 24 Jan 92 00:07:18 GMT
Original-Sender: [EMAIL PROTECTED]

If I wasn't such a wimp at this point I would have argued as John has;
his argument was exactly why Joe and I made the change.  However, the
reality is that I have become a wimp (about syntax, anyway).  Perhaps
I should resign as syntax czar??  (and nominate John!)

  -Paul