Re: [Haskell-cafe] Re: Why purely in haskell?

2008-01-14 Thread Luke Palmer
On Jan 15, 2008 12:29 AM, [EMAIL PROTECTED] wrote: Ben Franksen writes: [EMAIL PROTECTED] wrote: ... Does *MATH* answer the question what is: (0/0)==(0/0) ? Nope! Exactly. So why try to give an answer in Haskell? MATH says: the expression 0/0 is undefined, thus comparing (0/0)==(0/0)

Re: [Haskell-cafe] Re: Why purely in haskell?

2008-01-11 Thread Cristian Baboi
On Thu, 10 Jan 2008 19:38:07 +0200, Tillmann Rendel [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] wrote: Although it could be argued that laziness is the cause of some very obscure bugs... g Niko Example, PLEASE. Prelude sum [1..100] *** Exception: stack overflow Not true in Hugs.

Re: [Haskell-cafe] Re: Why purely in haskell?

2008-01-11 Thread Cristian Baboi
On Fri, 11 Jan 2008 09:16:12 +0200, Lennart Augustsson [EMAIL PROTECTED] wrote: Thank you Duncan, you took the words out of my mouth. :) On Jan 10, 2008 5:42 PM, Duncan Coutts [EMAIL PROTECTED] wrote: So let's imagine: ones = 1 : ones ones' = repeat 1 where repeat n = n : repeat n

Re: [Haskell-cafe] Re: Why purely in haskell?

2008-01-11 Thread Wolfgang Jeltsch
Am Freitag, 11. Januar 2008 08:11 schrieb Lennart Augustsson: Some people seem to think that == is an equality predicate. This is a big source of confusion for them; until they realize that == is just another function returning Bool they will make claims like [1..]==[1..] having an unnatural

Re: [Haskell-cafe] Re: Why purely in haskell?

2008-01-11 Thread Cristian Baboi
On Fri, 11 Jan 2008 09:11:52 +0200, Lennart Augustsson [EMAIL PROTECTED] wrote: Some people seem to think that == is an equality predicate. This is a big source of confusion for them; until they realize that == is just another function returning Bool they will make claims like [1..]==[1..]

Re: [Haskell-cafe] Re: Why purely in haskell?

2008-01-11 Thread Vladimir Zlatanov
However, the fact that (0 / 0) == (0 / 0) yields False is quite shocking. In my opinion it is the better than yielding True. 0/0 doesn't make sense. So it can't be compared to anything else which doesn't make sense. Whether == should yield False at all is another matter. It may be better to

Re: [Haskell-cafe] Re: Why purely in haskell?

2008-01-11 Thread Cristian Baboi
On Fri, 11 Jan 2008 09:11:52 +0200, Lennart Augustsson [EMAIL PROTECTED] wrote: Some people seem to think that == is an equality predicate. This is a big source of confusion for them; until they realize that == is just another function returning Bool they will make claims like [1..]==[1..]

Re: [Haskell-cafe] Re: Why purely in haskell?

2008-01-11 Thread Felipe Lessa
On Jan 11, 2008 7:47 AM, Miguel Mitrofanov [EMAIL PROTECTED] wrote: However, the fact that (0 / 0) == (0 / 0) yields False is quite shocking. Just for the record: the following is from Firebug (JavaScript debugger for Firefox) session: a = 0/0 NaN a == a false a === a false

Re: [Haskell-cafe] Re: Why purely in haskell?

2008-01-11 Thread Miguel Mitrofanov
However, the fact that (0 / 0) == (0 / 0) yields False is quite shocking. Just for the record: the following is from Firebug (JavaScript debugger for Firefox) session: a = 0/0 NaN a == a false a === a false ___ Haskell-Cafe mailing list

Re: [Haskell-cafe] Re: Why purely in haskell?

2008-01-11 Thread Miguel Mitrofanov
As GNU is not Unix, NaN is not a number, Since NaN /= NaN, I think, we should decipher NaN as Not a NaN instead. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Re: Why purely in haskell?

2008-01-11 Thread Ketil Malde
Wolfgang Jeltsch [EMAIL PROTECTED] writes: However, the fact that (0 / 0) == (0 / 0) yields False is quite shocking. It doesn’t adhere to any meaningful axiom set for Eq. Tough luck, but that's how floating point works, and what the numericalists know, and possibly even love (although I have

Re: [Haskell-cafe] Re: Why purely in haskell?

2008-01-11 Thread Jules Bean
Achim Schneider wrote: The list instance for Eq might eg. know something about the structure of the lists and be smart enough not to get caught in the recursion of x = 1:1:x and y = 1:1:1:y so it could successfully compare x == y to True in six compares. This would not be something about the

Re: [Haskell-cafe] Re: Why purely in haskell?

2008-01-11 Thread Cristian Baboi
On Fri, 11 Jan 2008 13:29:35 +0200, Wolfgang Jeltsch [EMAIL PROTECTED] wrote: Am Freitag, 11. Januar 2008 10:54 schrieb Wilhelm B. Kloke: Wolfgang Jeltsch [EMAIL PROTECTED] schrieb: However, the fact that (0 / 0) == (0 / 0) yields False is quite shocking. It doesn?t adhere to any

Re: [Haskell-cafe] Re: Why purely in haskell?

2008-01-11 Thread Wolfgang Jeltsch
Am Freitag, 11. Januar 2008 11:33 schrieben Sie: Wolfgang Jeltsch [EMAIL PROTECTED] writes: However, the fact that (0 / 0) == (0 / 0) yields False is quite shocking. It doesn’t adhere to any meaningful axiom set for Eq. Tough luck, but that's how floating point works, and what the

Re: [Haskell-cafe] Re: Why purely in haskell?

2008-01-11 Thread Wolfgang Jeltsch
Am Freitag, 11. Januar 2008 10:54 schrieb Wilhelm B. Kloke: Wolfgang Jeltsch [EMAIL PROTECTED] schrieb: However, the fact that (0 / 0) == (0 / 0) yields False is quite shocking. It doesn?t adhere to any meaningful axiom set for Eq. So I think that this behavior should be changed. Think

Re: [Haskell-cafe] Re: Why purely in haskell?

2008-01-11 Thread Ketil Malde
Ketil Malde [EMAIL PROTECTED] writes: The bombing of NaN *might* be a profound compilation option, but for people who really do numerical work, this is a blessing NOT to have it. I'll expand a bit of this, after I've checked with Wikipedia. Please correct me (and it) if I'm wrong, but: 1)

Re: [Haskell-cafe] Re: Why purely in haskell?

2008-01-11 Thread Cristian Baboi
On Fri, 11 Jan 2008 14:21:45 +0200, [EMAIL PROTECTED] wrote: Ketil Malde: Wolfgang Jeltsch: However, the fact that (0 / 0) == (0 / 0) yields False is quite shocking. It doesn’t adhere to any meaningful axiom set for Eq. Tough luck, but that's how floating point works, and what the

Re: [Haskell-cafe] Re: Why purely in haskell?

2008-01-11 Thread Roman Leshchinskiy
Wolfgang Jeltsch wrote: Am Freitag, 11. Januar 2008 11:33 schrieben Sie: Wolfgang Jeltsch [EMAIL PROTECTED] writes: However, the fact that (0 / 0) == (0 / 0) yields False is quite shocking. It doesn’t adhere to any meaningful axiom set for Eq. Tough luck, but that's how floating point works,

Re: [Haskell-cafe] Re: Why purely in haskell?

2008-01-11 Thread Lennart Augustsson
That would give you a language with a semantics I don't want to touch. Sometimes useful, yes, but far to intensional for my taste. -- Lennart On Jan 11, 2008 5:59 AM, Achim Schneider [EMAIL PROTECTED] wrote: Yes, thanks. I actually do think that many things would be easier if every

Re: [Haskell-cafe] Re: Why purely in haskell?

2008-01-11 Thread Ketil Malde
[EMAIL PROTECTED] writes: The difference between you (and/or Wolfgang J.) and myself is that I enjoy more my freedom, even if I have to pay with a little more work. You want to enforce rigid reactions of the system. You should be free to do it on *your* machine, not on mine. You are putting

Re: [Haskell-cafe] Re: Why purely in haskell?

2008-01-11 Thread Luke Palmer
On Jan 11, 2008 9:27 AM, Wolfgang Jeltsch [EMAIL PROTECTED] wrote: However, the fact that (0 / 0) == (0 / 0) yields False is quite shocking. It doesn't adhere to any meaningful axiom set for Eq. So I think that this behavior should be changed. Think of a set implementation which uses (==) to

Re: [Haskell-cafe] Re: Why purely in haskell?

2008-01-11 Thread Lennart Augustsson
If you talk to anyone who uses floating point numbers for real they would find (0/0)==(0/0) perfectly natural. It disobeys some axioms that Eq instances don't fulfill anyway, but changing it would make a lot of people surprised too. In general, the floating point instances break almost all axioms

Re: [Haskell-cafe] Re: Why purely in haskell?

2008-01-11 Thread Wolfgang Jeltsch
Am Freitag, 11. Januar 2008 13:21 schrieb [EMAIL PROTECTED]: Ketil Malde: Wolfgang Jeltsch: However, the fact that (0 / 0) == (0 / 0) yields False is quite shocking. It doesn’t adhere to any meaningful axiom set for Eq. Tough luck, but that's how floating point works, and what the

Re: [Haskell-cafe] Re: Why purely in haskell?

2008-01-11 Thread Ketil Malde
[EMAIL PROTECTED] writes: People, you are monsters. Well, bring on the torches and the pitchforks (although the image in my mind is more like a mob carrying lenses and bananas). no, some users are victims of its success as a formal language, not just as a coding tool I think Haskell's

Re: [Haskell-cafe] Re: Why purely in haskell?

2008-01-11 Thread Cristian Baboi
The thing is that y already is a *builtin* function in Haskell. On Fri, 11 Jan 2008 15:59:50 +0200, Achim Schneider [EMAIL PROTECTED] wrote: Cristian Baboi [EMAIL PROTECTED] wrote: So let's imagine: ones = 1 : ones ones' = repeat 1 where repeat n = n : repeat n (==) :: Eq a = a - a

Re: [Haskell-cafe] Re: Why purely in haskell?

2008-01-11 Thread Lennart Augustsson
If you can't stomach the weirdness of floating point then perhaps you should try to define your own type that obeys all the expected laws? :) On Jan 11, 2008 3:36 AM, Wolfgang Jeltsch [EMAIL PROTECTED] wrote: Am Freitag, 11. Januar 2008 11:03 schrieb Felipe Lessa: Another thing for the

Re: [Haskell-cafe] Re: Why purely in haskell?

2008-01-11 Thread Jonathan Cast
On 11 Jan 2008, at 5:13 AM, Achim Schneider wrote: Jonathan Cast [EMAIL PROTECTED] wrote: What kind of mathematics? I don't know of any mathematics where algebraic simplifications are employed without proof of the underlying equations (in some denotational model). Mathematics as, as my

Re: [Haskell-cafe] Re: Why purely in haskell?

2008-01-10 Thread Daniel Yokomizo
On Jan 10, 2008 3:36 PM, Achim Schneider [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] wrote: Niko Korhonen writes: ... Although it could be argued that laziness is the cause of some very obscure bugs... g Niko Example, PLEASE. [1..] == [1..] , for assumed operational

Re: [Haskell-cafe] Re: Why purely in haskell?

2008-01-10 Thread Tillmann Rendel
[EMAIL PROTECTED] wrote: Although it could be argued that laziness is the cause of some very obscure bugs... g Niko Example, PLEASE. Prelude sum [1..100] *** Exception: stack overflow Prelude Data.List.foldl' (+) 0 [1..100] 5050 Tillmann

Re: [Haskell-cafe] Re: Why purely in haskell?

2008-01-10 Thread Don Stewart
rendel: [EMAIL PROTECTED] wrote: Although it could be argued that laziness is the cause of some very obscure bugs... g Niko Example, PLEASE. Prelude sum [1..100] *** Exception: stack overflow Prelude Data.List.foldl' (+) 0 [1..100] 5050 See,

Re: [Haskell-cafe] Re: Why purely in haskell?

2008-01-10 Thread David Roundy
On Thu, Jan 10, 2008 at 10:10:21AM -0800, Don Stewart wrote: rendel: [EMAIL PROTECTED] wrote: Although it could be argued that laziness is the cause of some very obscure bugs... g Niko Example, PLEASE. Prelude sum [1..100] *** Exception: stack overflow Prelude

Re: [Haskell-cafe] Re: Why purely in haskell?

2008-01-10 Thread Tillmann Rendel
Achim Schneider wrote: [1..] == [1..] [some discussion about the nontermination of this expression] The essence of laziness is to do the least work necessary to cause the desired effect, which is to see that the set of natural numbers equals the set of natural numbers, which, axiomatically,

Re: [Haskell-cafe] Re: Why purely in haskell?

2008-01-10 Thread ajb
G'day all. Quoting [EMAIL PROTECTED]: Perhaps another example is more relevant, the tradeoffs space-time in the optimized version of the powerset generator... Yeah, I was going to bring up that topic. I've been lazy programming for 15 or so years, and the only bugs that I can think of are:

Re: [Haskell-cafe] Re: Why purely in haskell?

2008-01-10 Thread Luke Palmer
On Jan 11, 2008 12:09 AM, [EMAIL PROTECTED] wrote: 1. Indirect black holes that are not expressible in a strict language. You generally have to be doing something bizarre for this to occur, and it doesn't take too long before you can accurately predict when they constitute a likely risk.

Re: [Haskell-cafe] Re: Why purely in haskell?

2008-01-10 Thread ajb
G'day all. Quoting Luke Palmer [EMAIL PROTECTED]: What do you mean by black hole here? A black hole is what happens when evalation of something recursively depends on its own evaluation in such a way that no useful work can be done. An example is: let omega = omega + 1 in omega In

Re: [Haskell-cafe] Re: Why purely in haskell?

2008-01-10 Thread Duncan Coutts
On Fri, 2008-01-11 at 01:12 +0100, Achim Schneider wrote: Tillmann Rendel [EMAIL PROTECTED] wrote: Achim Schneider wrote: [1..] == [1..] [some discussion about the nontermination of this expression] The essence of laziness is to do the least work necessary to cause the

Re: [Haskell-cafe] Re: Why purely in haskell?

2008-01-10 Thread Jonathan Cast
On 10 Jan 2008, at 7:55 AM, Achim Schneider wrote: Daniel Yokomizo [EMAIL PROTECTED] wrote: On Jan 10, 2008 3:36 PM, Achim Schneider [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] wrote: Niko Korhonen writes: ... Although it could be argued that laziness is the cause of some very obscure

Re: [Haskell-cafe] Re: Why purely in haskell?

2008-01-10 Thread Lennart Augustsson
Some people seem to think that == is an equality predicate. This is a big source of confusion for them; until they realize that == is just another function returning Bool they will make claims like [1..]==[1..] having an unnatural result. The == function is only vaguely related to the equality

Re: [Haskell-cafe] Re: Why purely in haskell?

2008-01-10 Thread Lennart Augustsson
Thank you Duncan, you took the words out of my mouth. :) On Jan 10, 2008 5:42 PM, Duncan Coutts [EMAIL PROTECTED] wrote: On Fri, 2008-01-11 at 01:12 +0100, Achim Schneider wrote: Tillmann Rendel [EMAIL PROTECTED] wrote: Achim Schneider wrote: [1..] == [1..] [some discussion