Re: [GHC] #5818: gcd and fizzled reversed in event SparkCounters

2012-02-07 Thread GHC
#5818: gcd and fizzled reversed in event SparkCounters -+-- Reporter: MikolajKonarski | Owner: duncan Type: bug | Status: new Priority

Re: [GHC] #5818: gcd and fizzled reversed in event SparkCounters

2012-02-07 Thread GHC
#5818: gcd and fizzled reversed in event SparkCounters --+- Reporter: MikolajKonarski | Owner: duncan Type: bug | Status: closed Priority

Re: [GHC] #5818: gcd and fizzled reversed in event SparkCounters

2012-02-02 Thread GHC
#5818: gcd and fizzled reversed in event SparkCounters -+-- Reporter: MikolajKonarski | Owner: duncan Type: bug | Status: new Priority

Re: [GHC] #5818: gcd and fizzled reversed in event SparkCounters

2012-01-31 Thread GHC
#5818: gcd and fizzled reversed in event SparkCounters -+-- Reporter: MikolajKonarski | Owner: duncan Type: bug | Status: new Priority

[GHC] #5818: gcd and fizzled reversed in event SparkCounters

2012-01-26 Thread GHC
#5818: gcd and fizzled reversed in event SparkCounters -+-- Reporter: MikolajKonarski | Owner: duncan Type: bug | Status: new Priority

Re: [GHC] #3304: define gcd 0 0 = 0

2011-06-26 Thread GHC
#3304: define gcd 0 0 = 0 -+-- Reporter: stevec | Owner: Type: proposal| Status: closed Priority: normal | Milestone: 7.2.1

Re: [GHC] #3304: define gcd 0 0 = 0

2011-06-13 Thread GHC
#3304: define gcd 0 0 = 0 -+-- Reporter: stevec | Owner: Type: proposal| Status: closed Priority: normal | Milestone: 7.2.1

Re: [GHC] #3304: define gcd 0 0 = 0

2011-06-12 Thread GHC
#3304: define gcd 0 0 = 0 -+-- Reporter: stevec | Owner: Type: proposal| Status: closed Priority: normal | Milestone: 7.2.1

Re: [GHC] #3304: define gcd 0 0 = 0

2011-06-12 Thread GHC
#3304: define gcd 0 0 = 0 -+-- Reporter: stevec | Owner: Type: proposal| Status: closed Priority: normal | Milestone: 7.2.1

Re: [GHC] #3304: define gcd 0 0 = 0

2011-06-12 Thread GHC
#3304: define gcd 0 0 = 0 -+-- Reporter: stevec | Owner: Type: proposal| Status: closed Priority: normal | Milestone: 7.2.1

Re: [GHC] #3304: define gcd 0 0 = 0

2011-06-12 Thread GHC
#3304: define gcd 0 0 = 0 -+-- Reporter: stevec | Owner: Type: proposal| Status: closed Priority: normal | Milestone: 7.2.1

Re: [GHC] #3304: define gcd 0 0 = 0

2011-06-12 Thread GHC
#3304: define gcd 0 0 = 0 -+-- Reporter: stevec | Owner: Type: proposal| Status: closed Priority: normal | Milestone: 7.2.1

Re: [GHC] #3304: define gcd 0 0 = 0

2011-06-11 Thread GHC
#3304: define gcd 0 0 = 0 -+-- Reporter: stevec | Owner: Type: proposal| Status: patch Priority: normal | Milestone: 7.2.1

Re: [GHC] #3304: define gcd 0 0 = 0

2011-05-29 Thread GHC
#3304: define gcd 0 0 = 0 -+-- Reporter: stevec | Owner: Type: proposal| Status: patch Priority: normal | Milestone: 7.2.1

Re: [GHC] #3304: define gcd 0 0 = 0

2011-05-29 Thread GHC
#3304: define gcd 0 0 = 0 -+-- Reporter: stevec | Owner: Type: proposal| Status: patch Priority: normal | Milestone: 7.2.1

RE: Proposal: Make gcd total

2011-05-26 Thread Simon Peyton-Jones
23:48 | To: haskell-prime@haskell.org | Subject: Re: Proposal: Make gcd total | | On Wed, May 25, 2011 at 08:24:52PM +0200, Daniel Fischer wrote: | | If it's considered to be a small enough change so a libraries proposal | would be sufficient, all the better, but if not, I'd like to pursue

Re: Proposal: Make gcd total

2011-05-25 Thread Daniel Fischer
On Wednesday 18 May 2011 03:57:06 I wrote: Following http://hackage.haskell.org/trac/haskell-prime/wiki/Process#Proposals I hereby volunteer to become the proposal owner. So, how's this going to continue? It sparked a renewed go at simplifying the libraries proposal process, but since it

Re: Proposal: Make gcd total

2011-05-25 Thread Ian Lynagh
On Wed, May 25, 2011 at 08:24:52PM +0200, Daniel Fischer wrote: If it's considered to be a small enough change so a libraries proposal would be sufficient, all the better, but if not, I'd like to pursue the haskell-prime process further. My understanding is that for changes to libraries

Re: [GHC] #3304: define gcd 0 0 = 0

2011-05-18 Thread GHC
#3304: define gcd 0 0 = 0 -+-- Reporter: stevec | Owner: Type: proposal| Status: patch Priority: normal | Milestone: 7.2.1

Re: [GHC] #3304: define gcd 0 0 = 0

2011-05-18 Thread GHC
#3304: define gcd 0 0 = 0 -+-- Reporter: stevec | Owner: Type: proposal| Status: patch Priority: normal | Milestone: 7.2.1

Re: [GHC] #3304: define gcd 0 0 = 0

2011-05-10 Thread GHC
#3304: define gcd 0 0 = 0 -+-- Reporter: stevec | Owner: Type: proposal| Status: new Priority: normal | Milestone: Not GHC

Re: [GHC] #3304: define gcd 0 0 = 0

2011-05-10 Thread GHC
#3304: define gcd 0 0 = 0 -+-- Reporter: stevec | Owner: Type: proposal| Status: new Priority: normal | Milestone: 7.2.1

Re: [GHC] #3304: define gcd 0 0 = 0

2011-05-10 Thread GHC
#3304: define gcd 0 0 = 0 -+-- Reporter: stevec | Owner: Type: proposal| Status: new Priority: normal | Milestone: 7.2.1

Re: Proposal: Make gcd total

2011-05-10 Thread Judah Jacobson
On Mon, May 9, 2011 at 3:49 PM, Daniel Fischer daniel.is.fisc...@googlemail.com wrote: I would like to propose the elimination of the special error case gcd 0 0 = error Prelude.gcd: gcd 0 0 is undefined to replace it with gcd 0 0 = 0 (which would be an automatic consequence of removing

Proposal: Make gcd total

2011-05-09 Thread Daniel Fischer
I would like to propose the elimination of the special error case gcd 0 0 = error Prelude.gcd: gcd 0 0 is undefined to replace it with gcd 0 0 = 0 (which would be an automatic consequence of removing the above line). Rationale: 1. It makes gcd a total function. 2. It makes gcd associative. 3

Re: Proposal: Make gcd total

2011-05-09 Thread Cale Gibbard
+1 On 9 May 2011 19:11, Jacques Carette care...@mcmaster.ca wrote: +1 Jacques On 09/05/2011 6:49 PM, Daniel Fischer wrote: I would like to propose the elimination of the special error case gcd 0 0 = error Prelude.gcd: gcd 0 0 is undefined to replace it with gcd 0 0 = 0 (which would

Re: [GHC] #3304: define gcd 0 0 = 0

2010-05-04 Thread GHC
#3304: define gcd 0 0 = 0 -+-- Reporter: stevec | Owner: Type: proposal| Status: closed Priority: normal | Milestone: Not GHC

Re: [GHC] #2270: gcd is specialised only for Int

2009-07-17 Thread GHC
#2270: gcd is specialised only for Int +--- Reporter: dons |Owner: d...@galois.com Type: bug | Status: closed Priority

Re: [GHC] #3304: define gcd 0 0 = 0

2009-07-12 Thread GHC
#3304: define gcd 0 0 = 0 -+-- Reporter: stevec|Owner: Type: proposal | Status: new Priority: normal|Milestone: Not GHC

Re: [GHC] #3304: define gcd 0 0 = 0

2009-07-08 Thread GHC
#3304: define gcd 0 0 = 0 --+- Reporter: stevec| Owner: Type: proposal | Status: new Priority: normal| Milestone

[GHC] #3304: define gcd 0 0 = 0

2009-06-14 Thread GHC
#3304: define gcd 0 0 = 0 -+-- Reporter: stevec| Owner: Type: proposal | Status: new Priority: normal| Component: libraries/base

Re: [Haskell-cafe] gcd

2009-05-04 Thread Steve
Thanks for all the replies, it looks like there is a lot of support for having gcd 0 0 = 0. I've since discovered that there was a similar discussion in 2001, where the majority supported gcd 0 0 = 0, but the suggested change was never implemented. http://www.haskell.org/pipermail/haskell/2001

Re: [Haskell-cafe] Re: gcd

2009-05-03 Thread Daniel Fischer
Am Sonntag 03 Mai 2009 00:17:22 schrieb Achim Schneider: Steve stevech1...@yahoo.com.au wrote: It is useful to define gcd(0, 0) = 0 and lcm(0, 0) = 0 because then the natural numbers become a complete distributive lattice with gcd as meet and lcm as join operation. This extension

Re: [Haskell-cafe] Re: gcd

2009-05-03 Thread Luke Palmer
On Sat, May 2, 2009 at 4:17 PM, Achim Schneider bars...@web.de wrote: Steve stevech1...@yahoo.com.au wrote: It is useful to define gcd(0, 0) = 0 and lcm(0, 0) = 0 because then the natural numbers become a complete distributive lattice with gcd as meet and lcm as join operation

Re: [Haskell-cafe] Re: gcd

2009-05-03 Thread Nathan Bloomfield
Having gcd(0,0) = 0 doesn't mean that 0 is not divisible by any other natural number. On the contrary, any natural trivially divides 0 since n*0 = 0. Perhaps the disagreement is over what is meant by greatest. The greatest in gcd is not w.r.t. the canonical ordering on the naturals; rather w.r.t

[Haskell-cafe] Re: gcd

2009-05-03 Thread Achim Schneider
Nathan Bloomfield nblo...@gmail.com wrote: The greatest in gcd is not w.r.t. the canonical ordering on the naturals; rather w.r.t. the partial order given by the divides relation. This, to defend myself, was not how it was explained in high school. -- (c) this sig last receiving data

Re: [Haskell-cafe] Re: gcd

2009-05-03 Thread Nathan Bloomfield
This, to defend myself, was not how it was explained in high school. No worries. I didn't realize this myself until college; most nonspecialist teachers just don't know any better. Nor did, it appears, the original authors of the Haskell Prelude. :) BTW, this definition of gcd makes it possible

Re: [Haskell-cafe] Re: gcd

2009-05-03 Thread João Ferreira
Something that perhaps could be added is that leaving 0 `gcd` 0 undefined has two obvious annoying consequences: gcd is no longer idempotent (i.e. we don't have a `gcd` a = a, for all a), and it is no longer associative ((a `gcd` 0) `gcd` 0 is well-defined whilst a `gcd` (0 `gcd` 0

Re: [Haskell-cafe] Re: gcd

2009-05-03 Thread Daniel Fischer
Am Sonntag 03 Mai 2009 18:16:38 schrieb Achim Schneider: Nathan Bloomfield nblo...@gmail.com wrote: The greatest in gcd is not w.r.t. the canonical ordering on the naturals; rather w.r.t. the partial order given by the divides relation. Nitpick: it's not a partial order, but a preorder (2

Re: [Haskell-cafe] gcd

2009-05-03 Thread Hans Aberg
On 2 May 2009, at 04:05, Steve wrote: Why is gcd 0 0 undefined? In math, one may define gcd(x, y) as a generator of the ideal generated by x and y in the ring of integers Z. The gcd(x, y) then always exists as the ring Z is a PID (principal ideal domain), i.e., all ideals can

Re: [Haskell-cafe] gcd

2009-05-02 Thread Martijn van Steenbergen
Hi Steve, Steve wrote: Why is gcd 0 0 undefined? That's a good question. Can you submit an official proposal? http://www.haskell.org/haskellwiki/Library_submissions Thanks, Martijn. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http

[Haskell-cafe] Re: gcd

2009-05-02 Thread Achim Schneider
Steve stevech1...@yahoo.com.au wrote: It is useful to define gcd(0, 0) = 0 and lcm(0, 0) = 0 because then the natural numbers become a complete distributive lattice with gcd as meet and lcm as join operation. This extension of the definition is also compatible with the generalization

[Haskell-cafe] gcd

2009-05-01 Thread Steve
[Question moved over from Haskell-Beginners] I had a look at the gcd definition in GHC 6.10.1 ghc-6.10.1/libraries/base/GHC/Real.lhs -- | @'gcd' x y@ is the greatest (positive) integer that divides both @x@ -- and @y@; for example @'gcd' (-3) 6@ = @3@, @'gcd' (-3) (-6)@ = @3@, -- @'gcd' 0 4

Re: [GHC] #2270: gcd is specialised only for Int

2009-04-11 Thread GHC
#2270: gcd is specialised only for Int +--- Reporter: dons |Owner: d...@galois.com Type: bug | Status: new Priority

Re: [GHC] #2270: gcd is specialised only for Int

2008-10-04 Thread GHC
#2270: gcd is specialised only for Int -+-- Reporter: dons | Owner: [EMAIL PROTECTED] Type: bug | Status: new Priority

Re: [GHC] #2270: gcd is specialised only for Int

2008-07-31 Thread GHC
#2270: gcd is specialised only for Int -+-- Reporter: dons | Owner: [EMAIL PROTECTED] Type: bug | Status: new Priority: normal

Re: [GHC] #2270: gcd is specialised only for Int

2008-07-09 Thread GHC
#2270: gcd is specialised only for Int +--- Reporter: dons| Owner: [EMAIL PROTECTED] Type: bug | Status: new Priority: normal | Milestone: 6.10.1

Re: [GHC] #2270: gcd is specialised only for Int

2008-06-30 Thread GHC
#2270: gcd is specialised only for Int --+- Reporter: dons | Owner: [EMAIL PROTECTED] Type: bug | Status: new Priority: normal| Milestone: 6.10.1 Component

[GHC] #2270: gcd is specialised only for Int

2008-05-07 Thread GHC
#2270: gcd is specialised only for Int +--- Reporter: dons | Owner: [EMAIL PROTECTED] Type: bug | Status: new Priority: normal | Component: Compiler Version

RE: gcd 0 0 = 0

2001-12-19 Thread Kent Karlsson
is the supremum (result of max in the expression above) if a and b are both 0? (You're allowed to use values not prescribed by Haskell to exist. ;-) (You can replace divisors by factors in that expression and still get the same result.) I may agree that an operation *similar* to gcd, where 0,0 as argument

Re: gcd 0 0 = 0

2001-12-18 Thread Marc van Dongen
Ch. A. Herrmann ([EMAIL PROTECTED]) wrote: : In contrast, 0*x=0, thus 0 divides 0 (somehow). : But I have problems with gcd being the greatest positive integer ... [snip] : - 0 is not positive, it is non-negative or natural : - 2 also divides 0 and 2 is a greater integer than 0 : (0

Re: gcd 0 0 = 0

2001-12-18 Thread Marc van Dongen
Alan Bawden ([EMAIL PROTECTED]) wrote: :In case it isn't clear already, these definitions make a lattice on :the positive integers, with divides ~ leq, gcd ~ meet and lcm ~ join, :using the report's definitions of gcd and lcm. : : Indeed, that's a nice way of putting it. How about

RE: gcd 0 0 = 0

2001-12-18 Thread Ch. A. Herrmann
Simon == Simon Peyton-Jones [EMAIL PROTECTED] writes: Simon Christoph does not like this It's OK if the definition is clear; it wasn't using the words positive or greatest integer. Stating gcd 0 0 = 0 explicitly is a good thing, even if it could be expressed verbatim; people may think

Re: gcd 0 0 = 0

2001-12-18 Thread Lars Henrik Mathiesen
From: Marc van Dongen [EMAIL PROTECTED] Date: Tue, 18 Dec 2001 09:32:49 + Alan Bawden ([EMAIL PROTECTED]) wrote: : Indeed, that's a nice way of putting it. How about if the report just : says: : :In order to make the non-negative integers into a lattice under `gcd

Re: gcd 0 0 = 0

2001-12-18 Thread Marc van Dongen
Lars Henrik Mathiesen ([EMAIL PROTECTED]) wrote: : Alan Bawden ([EMAIL PROTECTED]) wrote: : : Indeed, that's a nice way of putting it. How about if the report just : : says: : : : :In order to make the non-negative integers into a lattice under `gcd' : :and `lcm', we define `gcd

RE: gcd 0 0 = 0

2001-12-18 Thread Kent Karlsson
(in the ordinary sense) divisor of 0. Indeed, +infinity is a much larger divisor of 0... I'm not in favour of using a very special-purpose order, not used for anything else, and that isn't even an order but a preorder, just to motivate gcd 0 0 = 0. Even if using this very special-purpose preorder

Re: gcd 0 0 = 0

2001-12-18 Thread Dylan Thurston
.) This thread made me curious, so I did a little library research. I was surprised to discover that mathematicians discover on this, the domain of definition of gcd a b: DomainReferences ---- a /= 0, b /= 0Lang, Algebra, 3rd Edition Hasse, Number

Re: gcd 0 0 = 0

2001-12-18 Thread Michael Ackerman
of polynomials over a field. Here the non-zero elements of the field are the units; no one has ever suggested calling them primes! In a general UFD one can only speak of _a_ gcd of two elements x and y, meaning an element d such that one has (x, y) = (d), an equality of ideals. In some special cases

Re: gcd 0 0 = 0

2001-12-18 Thread Jan de Wit
Why not define gcd a b as the largest (in 'normal' order) integer d such that the set of sums of multiples of a and b {na+mb | n - Z, m - Z} is equal to the set of multiples of d {nd | n - Z}? Easy to understand, no talk of division, lattices, rings, ideals etcetera, and it covers the cases

gcd oops

2001-12-18 Thread Michael Ackerman
Sorry for an error in my previous message. The definition there of a gcd works only in a prinicpal ideal domain (which covers all the rings mentioned in the examples). According to Bourbaki, chapter on ordered groups, the gcd of two non-zero elements of a UFD A is well-defined as an element

Re: gcd 0 0 = 0

2001-12-17 Thread Lars Henrik Mathiesen
From: Marc van Dongen [EMAIL PROTECTED] Date: Sun, 16 Dec 2001 13:35:59 + Marc van Dongen ([EMAIL PROTECTED]) wrote: : An integer $a$ divides integer $b$ if there exists an integer : $c$ such that $a c= b$. To make clear why $0$ (and not any other non-zero integer) is the gcd

Re: gcd 0 0 = 0

2001-12-17 Thread George Russell
I've reconsidered my earlier position and think now that the Prelude is wrong to make gcd 0 0 an error, and should return 0. It probably doesn't make much difference to anyone, but it's like 1 not being a prime; it may be slightly harder to explain, but it makes the maths come out nicer

Re: gcd 0 0 = 0

2001-12-17 Thread Ch. A. Herrmann
George == George Russell [EMAIL PROTECTED] writes: George I've reconsidered my earlier position and think now that the George Prelude is wrong to make gcd 0 0 an error, and should return George 0. It probably doesn't make much difference to anyone, but George it's like 1

Re: gcd 0 0 = 0

2001-12-17 Thread Alan Bawden
From: Lars Henrik Mathiesen [EMAIL PROTECTED] Date: 17 Dec 2001 14:50:21 - ... In case it isn't clear already, these definitions make a lattice on the positive integers, with divides ~ leq, gcd ~ meet and lcm ~ join, using the report's definitions of gcd and lcm. Indeed

gcd definition

2001-12-16 Thread S.D.Mechveliani
Simon Peyton-Jones [EMAIL PROTECTED] writes [..] If someone could write a sentence or two to explain why gcd 0 0 = 0, (ideally, brief ones I can put in the report by way of explanation), I think that might help those of us who have not followed the details of the discussion. Here

Re: gcd 0 0 = 0

2001-12-16 Thread Marc van Dongen
Marc van Dongen ([EMAIL PROTECTED]) wrote: : An integer $a$ divides integer $b$ if there exists an integer : $c$ such that $a c= b$. [snip] : gcd 0 0 = 0; and : gcd 0 0 /= error Blah To make clear why $0$ (and not any other non-zero integer) is the gcd of $0$ and $0$ I should have added

Re: gcd 0 0 = 0

2001-12-15 Thread Alan Bawden
From: Simon Peyton-Jones [EMAIL PROTECTED] Date: Fri, 14 Dec 2001 01:18:56 -0800 ... If someone could write a sentence or two to explain why gcd 0 0 = 0, (ideally, brief ones I can put in the report by way of explanation), I think that might help those of us who have

RE: gcd 0 0 = 0

2001-12-14 Thread Simon Peyton-Jones
|Probably, the best specification would be | | gcd n m :: Integer = if n == 0 m == 0 then 0 | else | greatest integer that divides both n and m Well, thank you all those that have contributed. My original point was simply to say

Re: gcd 0 0 = 0

2001-12-14 Thread Marc van Dongen
Simon Peyton Jones ([EMAIL PROTECTED]) wrote: : If someone could write a sentence or two to explain why gcd 0 0 = 0, : (ideally, brief ones I can put in the report by way of explanation), : I think that might help those of us who have not followed the details : of the discussion. Division

gcd 0 0 = 0

2001-12-13 Thread S.D.Mechveliani
People write on gcd 0 0 : Alan Bawden [EMAIL PROTECTED] If you take the point-of-view that gcd is actually an operation on ideals, then gcd(0, 0) is 0. I.e. define gcd(x, y) to be the smallest z = 0 such that {m*x + n*y | m, n in Z} = {n*z | n in Z}. This is probably the most natural

Re: gcd 0 0 = 0

2001-12-13 Thread Alan Bawden
From: S.D.Mechveliani [EMAIL PROTECTED] Date: Thu, 13 Dec 2001 12:53:32 +0300 Further, the definintion gcd(x, y) to be the smallest z = 0 such that {m*x + n*y | m, n in Z} = {n*z | n in Z} is not natural. In particular, how does it generalize to gcd X Y

GCD

2001-12-11 Thread Simon Peyton-Jones
About the GCD operator, the Haskell Report currently says: gcd x y is the greatest integer that divides both x and y. lcm x y is the smallest positive integer that both x and y divide. Why does 'lcm' say 'positive' while 'gcd' does not? What is gcd -3 -6 Presumably 3, not -3. You

Re: GCD

2001-12-11 Thread Ch. A. Herrmann
Simon == Simon Peyton-Jones [EMAIL PROTECTED] writes: Simon gcd x y is the greatest POSITIVE integer that divides Simon both x and y. Simon I don't think that changes the specification in fact, but Simon experience has led me to always check these things! I find

Re: GCD

2001-12-11 Thread John Meacham
On Tue, Dec 11, 2001 at 11:06:28AM +0100, Ch. A. Herrmann wrote: Simon == Simon Peyton-Jones [EMAIL PROTECTED] writes: Simongcd x y is the greatest POSITIVE integer that divides Simon both x and y. Simon I don't think that changes the specification in fact, but Simon

Re: GCD

2001-12-11 Thread S.M.Kahrs
The natural reading of 'greatest' is, of course, the greatest in the divisibility preorder (it's partial order on natural numbers but only a preorder on integers). Thus, gcd 0 0 = 0. 3 and -3 are equivalent in that preoder. Thus, an additional comment may be in order. Stefan

Re: GCD

2001-12-11 Thread Keith Wansbrough
Simongcd x y is the greatest POSITIVE integer that divides Simon both x and y. I find it confusing to read a definition which contains redundant information. Instead, I'd suggest to add something like: Note: this number is always positive Or, perhaps easier on the eye

gcd 0 0

2001-12-11 Thread S.D.Mechveliani
People write about the Report definition of gcd x y as of greatest integer that divides x and y, and mention gcd 0 0 = 0 But 2 also divides 0, because 2*0 = 0. Does the Report specify that gcd 0 0 is not defined? For an occasion

RE: GCD

2001-12-11 Thread Kent Karlsson
$)\\ \$= \infinitary(\posinf)$ \if $x = 0$ and $y = 0$ \end{example} % There is no need to say v0 above, since there are always positive values in that % set, and max picks the largest/greatest one. 0 has all integer values except(!) 0 % as divisors. So for gcd 0 0 (maximum, supremum really

gcd 0 0

2001-12-11 Thread George Russell
S.D.Mechveliani wrote Does the Report specify that gcd 0 0 is not defined? Yes. The Report definition says gcd :: (Integral a) = a - a - a gcd 0 0 = error Prelude.gcd: gcd 0 0 is undefined gcd x y = gcd

Re: gcd 0 0

2001-12-11 Thread Alan Bawden
From: George Russell [EMAIL PROTECTED] Date: Tue, 11 Dec 2001 18:18:31 +0100 ... Yes. The Report definition says gcd :: (Integral a) = a - a - a gcd 0 0 = error Prelude.gcd: gcd 0 0 is undefined gcd x y = gcd' (abs x) (abs y

gcd :: [a] - a

2000-05-21 Thread S.D.Mechveliani
On my proposal for minBy, gcd ... :: [a] - a and remark on +, ... being the exceptions Matt Harden [EMAIL PROTECTED] writes on 19 May 2000 (+), () ... are different. Because they have classical tradition to be applied as binary infix operations. And gcd, min, max, lcm have

Re: gcd :: [a] - a

2000-05-21 Thread Marcin 'Qrczak' Kowalczyk
Sun, 21 May 2000 11:53:39 +0400 (MSD), S.D.Mechveliani [EMAIL PROTECTED] pisze: The economy of names is more important. Convenience of programming is important too. Many Prelude functions are unnecessary, but are convenient. (++) and concat are not needed (you can write flip (foldr (:)) for

Re: gcd :: [a] - a

2000-05-21 Thread Matt Harden
"S.D.Mechveliani" wrote: When processing this tree, it would be natural to write in each node m + b and min [m,b]. The former is "necessary" due to the infix-binary tradition. The latter uses [,] because it is good to have one function min for a list and for

RE: Query re gcd() in Haskell 98

1999-02-01 Thread Simon Peyton-Jones
-Original Message- From: michael abbott [mailto:[EMAIL PROTECTED]] Sent: Monday, February 01, 1999 10:47 AM To: Simon Peyton-Jones Cc: [EMAIL PROTECTED] Subject: Query re gcd() in Haskell 98 It seems a bit late to raise this, but I notice that the standard prelude for Haskell 98

Query re gcd() in Haskell 98

1999-02-01 Thread michael abbott
It seems a bit late to raise this, but I notice that the standard prelude for Haskell 98 in the final draft still defines gcd 0 0 = error ... I remember some inconclusive discussion on this some time ago, but there is no reason not to let gcd 0 0 == 0, as would happen anyway without

Re: gcd(0,0), reply

1996-11-09 Thread Marnix Klooster
[If this whole 'gcd' discussion is getting 'too mathematical' for this list, I propose to continue it by private e-mail with members of the Haskell committee. If so, please give me an e-mail address to contact.] At 09:16 6-11-96 +0300, you wrote in reply to my 'Why not make "gcd 0

gcd definition, apology for mistake

1996-11-09 Thread S.D.Mechveliani
Dear all, I am very sorry for something like misprinting tragically in the classic gcd definition. I had written " gcd(a,b) is the *greatest* by inclusion ideal (d) among the ones with the property of (d) = {x*d | x - R} to be *contained inside* (

gcd(0,0), reply

1996-11-06 Thread S.D.Mechveliani
Hello, there was recently a letter on the subject like " gcd(0,0) should be 0 ". Unfortunately, I had lost it and cannot citate. Here are simple considerations to prevent the confusion. (1) gcd(0,0) = 0 is all right. But setting this wo

gcd(0,0) really is zero!

1996-11-06 Thread michael
In response to Marnix Klooster [EMAIL PROTECTED] and S.D.Mechveliani [EMAIL PROTECTED], can I offer another mathematic perspective to explain why gcd(0,0) should be zero? Just looking at the natural numbers, the relationship "a divides b", written a|b, defines a partial orde