ANNOUNCE: hsclock-0.01.0 release

2001-12-18 Thread Jens-Ulrik Petersen
I am pleased to announce the initial release of hsclock, another gtk+hs applet I've written. hsclock is an accurate multi-zone gtk clock, which can also run in a tty. hsclock uses gtk timeouts to synchronise the time updates to occur on the second or minute tick (dependent on the clock format

RE: ghc-5.02 refuses to open a device file

2001-12-18 Thread Simon Marlow
I guess it's a [mis]feature, since 5.00 worked, but can hardly imagine anybody could need it. === Prelude h-IO.openFile /dev/zero IO.ReadMode *** Exception: unsupported operation Action: openFile Reason: unknown file type File: /dev/rtf0 Prelude Leaving GHCi. max@max$cat

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 is the

ANNOUNCE: hsclock-0.01.0 release

2001-12-18 Thread Jens-Ulrik Petersen
I am pleased to announce the initial release of hsclock, another gtk+hs applet I've written. hsclock is an accurate multi-zone gtk clock, which can also run in a tty. hsclock uses gtk timeouts to synchronise the time updates to occur on the second or minute tick (dependent on the clock format

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

Haskell 98 IO

2001-12-18 Thread Simon Peyton-Jones
| Anyway, what should the report say? I think it is reasonable | to expect that stdin stdout should both be unbuffered in | order for interact to work right. So the defn of interact should be | | interact f = do | hSetBuffering stdin NoBuffering -- new | hSetBuffering stdout

4th Int'l Symp.: Practical Aspects of Declarative Languages

2001-12-18 Thread Dr. Gopal Gupta
[ o Apologies for multiple messages. o Please register and make hotel reservations as soon as possible since both deadlines are approaching fast (Dec. 27th) ]. You are cordially invited to the Fourth International Symposium on Practical Aspects of Declarative Languages that will be

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: space efficiency question

2001-12-18 Thread Frank Dellaert
Title: Message Thanks ! Now, a small follow-up question: if I subsequently test 2 Instances whether they were instantiated with the same Attributes value, as in test (Instance a1 _) (Instance a2 _) = (a1==a2) will this be implemented efficiently ? I.e. will it check first whether the

Re: space efficiency question

2001-12-18 Thread Janis Voigtlaender
Frank Dellaert asks: test (Instance a1 _) (Instance a2 _) = (a1==a2) will this be implemented efficiently ? I.e. will it check first whether the pointers happen to be the same, and only then do a full Eq comparison ? No, otherwise you might also expect that the following test' function:

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' :and

x^y

2001-12-18 Thread Toralf Wittner
Hello, you can count me as a newbie in functional programming. I'm attempting to define a function that computes the value of x^y for whole numbers. Intuively (all efficiency considerations aside) I would start with something like this: power x y | x == 0= 0 | y == 0

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
Simon == Simon Peyton-Jones [EMAIL PROTECTED] writes: Simon Christoph does not like this I still don't like this. 0 has never, and will never, divide anything, in particular not 0. 0 may be a prime factor of 0 (see also below!), but that is different. It is not the greatest (in the

Re: gcd 0 0 = 0

2001-12-18 Thread Dylan Thurston
On Tue, Dec 18, 2001 at 06:00:30PM +0100, Kent Karlsson wrote: Why? If EVERY natural number is to have a prime factorisation, then BOTH 0 AND 1 have to be promoted to prime numbers; 1 has a perfectly fine prime factorization. It is the product of 0 primes, the null product. (A null product

Re: gcd 0 0 = 0

2001-12-18 Thread Michael Ackerman
The general meaning of `having a prime factorization' is that every non-zero element is uniquely a product of a unit and a product of primes. The algebraic structures where unique factorizations live are `unique factorization domains' (UFDs) of which a central class is formed by the ring of

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 with

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 of