[prev in list] [next in list] [prev in thread] [next in thread] 

List:       haskell
Subject:    prefix minus
From:       "Rector L. Page" <zrlp09 () trc ! amoco ! com>
Date:       1991-03-13 0:39:07
Message-ID: 9103122209.AA25185 () backus ! trc ! amoco ! com
[Download RAW message or body]

Original-Via: uk.ac.nsf; Tue, 12 Mar 91 22:27:19 GMT
Date: Tue, 12 Mar 91 16:09:15 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

I tried to get this message out before, but had some problems with control
characters and lost lines:

The problem with making unary minus equivalent to negate is that it allows
a particular view of consistency to prevail over hundreds of years of human 
experience.  Generations of statisticians would be surprised to find that
(\x -> exp(-x^2)) denotes a non-integrable function in Haskell.  

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 nearly 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




[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic