Thu, 01 Jun 2000 09:27:05 -0700, Jeffrey R. Lewis <[EMAIL PROTECTED]> pisze:
> BTW, `subtract' doesn't really help, since it's also asymmetrical
> - there's no corresponding `add'. I had a piece of code where
> one case was adding x, and the other was subtracting it. I was
> simply grumbling th
Zhanyong Wan wrote:
> "Jeffrey R. Lewis" wrote:
>
> > Jan Skibinski wrote:
> >
> > > On Thu, 1 Jun 2000, Jeffrey R. Lewis wrote:
> > >
> > > > No so, of course. (- x) means `negate x'. Bummer. What an unpleasant bit of
> > > > asymmetry!
> > >
> > > How about ((-) x) ?
> >
> > That, re
Date sent: Thu, 01 Jun 2000 08:47:23 -0700
From: "Jeffrey R. Lewis" <[EMAIL PROTECTED]>
Organization: Galois Connections
To: Jan Skibinski <[EMAIL PROTECTED]>
Copies to: [EMAIL PROTECTED]
Subject:
On 01-Jun-2000, Jeffrey R. Lewis <[EMAIL PROTECTED]> wrote:
> You can write the section (+ x) to specify a function to add `x' to
> something. That's great, then you need to specify a function for subtracting
> `x' from something. Great, you just type in: (- x), and you're done, right?
>
> No
Hi Jeff,
| You can write the section (+ x) to specify a function to add `x' to
| something. That's great, then you need to specify a function for
| subtracting `x' from something.
This is why the "subtract" function is included in the Prelude:
Prelude> map (subtract 1) [1..10]
[0,1,2,3
"Jeffrey R. Lewis" wrote:
> Jan Skibinski wrote:
>
> > On Thu, 1 Jun 2000, Jeffrey R. Lewis wrote:
> >
> > > No so, of course. (- x) means `negate x'. Bummer. What an unpleasant bit of
> > > asymmetry!
> >
> > How about ((-) x) ?
>
> That, regrettably, is the wrong function. That func
Jan Skibinski wrote:
> On Thu, 1 Jun 2000, Jeffrey R. Lewis wrote:
>
> > No so, of course. (- x) means `negate x'. Bummer. What an unpleasant bit of
> > asymmetry!
>
> How about ((-) x) ?
That, regrettably, is the wrong function. That function is \y -> x - y. I wanted
\y -> y - x.
On Thu, 1 Jun 2000, Jeffrey R. Lewis wrote:
> No so, of course. (- x) means `negate x'. Bummer. What an unpleasant bit of
> asymmetry!
How about ((-) x) ?
Jan