Hello,
I've got a question regarding let-floating [1].
Consider the following two versions of the quicksort algorithm:
> qsort1 l = f l []
> where f [] = (\y -> y)
> f (x:xs) = let (xs_1,xs_2) = part ( in (\y -> f xs_1 (x:(f xs_2 y)))
> qsort2 l = f l []
> There are a couple things to do that can at least cut down on spam.
>
> 1) Make sure that your mail gateway, or (in this case) the mailing
>list host is not an open relay site.
It isn't.
> 2) Every time you get spam, locate all the hosts it came through
>in the header.
Or alternati
| Is there a compiler (which version?) that optimizes qsort1 to
| (essentially) qsort2 ?
|
| Any hints concerning the possibility/impossibility of this
| would be helpful. Thanks and regards, Janis.
Alas, (still) not yet. As you say, the transformation depends
on spotting a one-shot lambda, a
Fpr the Revised Haskell 98 report, Russell O'Connor suggests:
| Also, I understand you are reluctant to make library changes,
| but sinh and cosh can easily be defined in terms of exp
|
| sinh x = (exp(x) - exp(-x))/2
| cosh x = (exp(x) + exp(-x))/2
|
| (source: Calculus Third E
Sun, 14 Oct 2001 23:25:40 -0400, Ken Shan <[EMAIL PROTECTED]> pisze:
> In Haskell's standard IO module, bracket_ is defined to have type
>
> IO a -> (a -> IO b) -> IO c -> IO c
>
> However, in the Exception module in hslibs, bracket_ has type
>
> IO a -> IO b -> IO c -> IO c
>
> which
Simon Peyton-Jones:
>
> Russell O'Connor suggests:
> | but sinh and cosh can easily be defined in terms of exp
> |
> | sinh x = (exp(x) - exp(-x))/2
> | cosh x = (exp(x) + exp(-x))/2
> | I suggest removing sinh and cosh from the minimal complete
> | definition, and add the above defaults.
>
>
> 2. So, they hold for the Complex numbers as well. The gymnastics with
>complex sinh and cosh seems to be redundant.
Well, I would be a little careful changing these. Some of the definitions
in numerical part of the Prelude look more convoluted than they need to
be, but it's because they hav
> | sinh x = (exp(x) - exp(-x))/2
> | cosh x = (exp(x) + exp(-x))/2
...
> This looks pretty reasonable to me. We should have default methods
> for anything we can.
Why not provide defaults for the inverse functions as well?
asinh x = log (x + sqrt (1+x*x))
acosh x = log (x + (x+1) * sqr
- Original Message -
From: "Jerzy Karczmarczuk" <[EMAIL PROTECTED]>
...
> Simon Peyton-Jones:
> >
> > Russell O'Connor suggests:
>
> > | but sinh and cosh can easily be defined in terms of exp
> > |
> > | sinh x = (exp(x) - exp(-x))/2
> > | cosh x = (exp(x) + exp(-x))/2
>
> > | I sugg
| > 1. Actually, I wouldn't even call that "default
| definitions". These ARE
| >definitions of sinh and cosh.
|
| Mathematically, yes. Numerically, no. Even if 'exp' is
| implemented with high accuracy, the suggested defaults may
| return a very inaccurate (in ulps) result. Take sinh n
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
On Mon, 15 Oct 2001, Lennart Augustsson wrote:
> Why not provide defaults for the inverse functions as well?
>
> asinh x = log (x + sqrt (1+x*x))
> acosh x = log (x + (x+1) * sqrt ((x-1)/(x+1)))
> atanh x = log ((x+1) / sqrt (1 - x*x))
T
> That's a good idea too.
> Is there a reason for defining acosh as above instead of
> acosh x = log(x + sqrt(x*x-1))
If there is one I can't remember it. :-)
-- Lennart
___
Haskell mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/
CALL FOR PAPERS
RTA 2002
13th International Conference on Rewriting Techniques and Applications
July 22--24, Copenhagen, Denmark
Simon PJ wrote:
> Fpr the Revised Haskell 98 report, Russell O'Connor suggests:
> =20
> | Also, I understand you are reluctant to make library changes,=20
> | but sinh and cosh can easily be defined in terms of exp
> |=20
> | sinh x =3D (exp(x) - exp(-x))/2
> | cosh x =3D (exp(x) + e
On Mon, Oct 15, 2001 at 06:27:52PM +0200, George Russell wrote:
> Simon PJ wrote:
> > Fpr the Revised Haskell 98 report, Russell O'Connor suggests:
> > =20
> > | Also, I understand you are reluctant to make library changes,=20
> > | but sinh and cosh can easily be defined in terms of
Dylan Thurston wrote:
[snip]
> > No. As has been pointed out, this is a bad idea numerically because
> > it will give the wrong answer for sinh x for very small values of
> > x. As a matter of fact, you will also get the wrong answer for very large
> > values of x, where exp(x) can overflow even
Dear Haskellers,
after the first rush of volunteers seems to have ebbed away, it is
probably time for a reminder. First, the good news:
We have just about enough topics covered to convince me that it makes
sense to go ahead. So the Haskell Communities page has moved to a more
permanent location
> Or alternatively just report it using Spamcop (http://spamcop.net) or
> some other reporting tool. Life is just too short to do this by hand
> every time you get spam.
CAUCE (The Coalition Against Unsolicited Commercial Email) seems to me a
nice alternative. Check www.cauce.org.
> On the Hask
On 15-Oct-2001, Simon Peyton-Jones <[EMAIL PROTECTED]> wrote:
>
> The proposal is only to give "default declarations"
> in the class defn for sinh, cosh, and perhaps as Lennart suggests
> asinh, acosh, atanh. They give a reasonable first cut if you
> don't write definitions yourself. But you
19 matches
Mail list logo