[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

prefix minus



Original-Via: uk.ac.nsf; Tue, 12 Mar 91 00:19:09 GMT
Date: Mon, 11 Mar 91 16:21:09 CST
From: "Rector L. Page" <zrlp09@trc.amoco.com>
To: haskell@edu.yale.cs
Subject: prefix minus
Original-Sender: zrlp09 <zrlp09%com.amoco.trc@yale.edu>
Sender: haskell-request@cs.glasgow.ac.uk

The problem with compiler writers is they think their view of consistency	ought to prevail over hundreds of years of human experience.   Programming
is not mathematics, but one virtue of functional programs is that they come	closer to mathematics than conventional ones.  The Haskell committee's
decision to exclude general prefix operators was probably a good one.  Why	not stick with that decision and "hack in" the only one needed?  But hack	it in so as not to surprise virtually everyone who reads a formula making
use of it.  People requiring a "consistent" view may think of prefix minus
not as a unary operator, but as a binary one with an implicit left-hand
operand.  Then -2^2, -2+2, and -2/2 parse (consistently) as 0-2^2, 0-2+2,
and 0-2/2.

Rex