Implementing the Show class for a Hash

2001-02-07 Thread Shlomi Fish
Hi! I've written a hash implementation in pure Haskell. The hash is more of a collection of elements organized in a table of linked lists, and it can serve as a dictionary by having each one be a key-value pair. However, I ran into problems when implementing the show function and hugs keeps

Re: Revamping the numeric classes

2001-02-07 Thread Ch. A. Herrmann
moved to haskell-cafe Ketil E.g. way back, I wrote a simple differential equation solver. Ketil Now, the same function *could* have been applied to vector Ketil functions, except that I'd have to decide on how to implement Ketil all the "Num" stuff that really didn't fit well.

Re: Fundeps and quantified constructors

2001-02-07 Thread anatoli
Hi everybody: I think I've found what's the problem. Still no solution in sight :( The problem has nothing to do with fundeps. Consider an example: data Foo a = (Eq a) = MkFoo a This gives the same error message: type variable a is not locally bound. Apparently, 'a' in 'Eq a' hides 'a' in

Re: Revamping the numeric classes

2001-02-07 Thread Marcin 'Qrczak' Kowalczyk
On Wed, 7 Feb 2001, Bjorn Lisper wrote: I'd like to point out the connection between the use of +, - on vector spaces and * for scaling with features in some data parallel languages. In these languages, writing a + b where a and b are arrays of numerics is interpreted as elementwise

8th Static Analysis Symposium : Last CFP

2001-02-07 Thread Radhia Cousot
My apologies for duplicates of this announcement= = = = =Call For Papers= =

RE: GHC Core Language

2001-02-07 Thread Andrew Tolmach
[moving to haskell-cafe] From: matt hellige [mailto:[EMAIL PROTECTED]] a quick question re: ghc's Core language... is it still very similar to the abstract syntax given in, for example, santos' "compilation by transformation..." (i think it was his dissertation?) and elsewhere, or has it

Re: Revamping the numeric classes

2001-02-07 Thread Bjorn Lisper
Marcin 'Qrczak' Kowalczyk: Me: I'd like to point out the connection between the use of +, - on vector spaces and * for scaling with features in some data parallel languages. In these languages, writing a + b where a and b are arrays of numerics is interpreted as elementwise addition of a and

GHC 4.08.2: the release dribbles on

2001-02-07 Thread Reuben Thomas
As of now, several things have been corrected: 1. Sparc HC files are available. 2. The Windows link actually points to the 4.08.2 release, not the 4.08.1 release. 3. RedHat 6 i386 RPMs are available. -- http://sc3d.org/rrt/ | computation, n. automated pedantry

Re: names, modules, types

2001-02-07 Thread Marcin 'Qrczak' Kowalczyk
Wed, 7 Feb 2001 10:08:14 +0100 (MET), Johannes Waldmann [EMAIL PROTECTED] pisze: getLine:: IO String; getLine :: Handle - IO String At each usage of getLine, the typechecker should follow both tracks, and take the one that is type-correct. There is exponential growth of possibilities in

Re: Revamping the numeric classes

2001-02-07 Thread Marcin 'Qrczak' Kowalczyk
Wed, 7 Feb 2001 13:04:12 +0100 (MET), Bjorn Lisper [EMAIL PROTECTED] pisze: A natural principle to adopt is that an already typeable expression should not be transformed. This will for instance resolve the ambiguity in the list of list example: if l :: [[a]] then length l is already

'Convertible' class?

2001-02-07 Thread Dylan Thurston
In thinking about various issues with the numeric classes, I came up with the following question: Is there a problem with having a class 'Convertible' as follows? class Convertible a b where convert :: a - b So, e.g., fromInteger and fromRational could be replaced with convert. (But if

Re: 'Convertible' class?

2001-02-07 Thread Hannah Schroeter
Hello! On Wed, Feb 07, 2001 at 03:43:59PM -0500, Dylan Thurston wrote: In thinking about various issues with the numeric classes, I came up with the following question: Is there a problem with having a class 'Convertible' as follows? class Convertible a b where convert :: a - b

Re: 'Convertible' class?

2001-02-07 Thread Dylan Thurston
On Wed, Feb 07, 2001 at 10:19:33PM +0100, Hannah Schroeter wrote: Hello! On Wed, Feb 07, 2001 at 03:43:59PM -0500, Dylan Thurston wrote: In thinking about various issues with the numeric classes, I came up with the following question: Is there a problem with having a class

Re: Revamping the numeric classes

2001-02-07 Thread Bjorn Lisper
Marcin Kowalczyk: Me: A natural principle to adopt is that an already typeable expression should not be transformed. This will for instance resolve the ambiguity in the list of list example: if l :: [[a]] then length l is already well-typed and should not be transformed into map length l. So

Re: Revamping the numeric classes

2001-02-07 Thread Dylan Thurston
On Tue, Feb 06, 2001 at 10:29:36PM +0100, Andreas Gruenbacher wrote: ... Also not all instances of Num can be shown. I have a monad that is an instance of Num, for example. I cannot possibly show the monad. I've been thinking about this a little. It's quite an interesting problem in general

Re: 'Convertible' class?

2001-02-07 Thread Hannah Schroeter
Hello! On Wed, Feb 07, 2001 at 05:43:40PM -0500, Dylan Thurston wrote: [...] class Subtype a b where {- a is subtype of b, if following operations exist -} inject :: a - b project :: b - Maybe a Shouldn't this be a subclass? 'project' is not always easy or possible to define.

`Covertible' class. Reply.

2001-02-07 Thread S.D.Mechveliani
Dylan Thurston [EMAIL PROTECTED] writes In thinking about various issues with the numeric classes, I came up with the following question: Is there a problem with having a class 'Convertible' as follows? class Convertible a b where convert :: a - b [..] The basic algebra

Re: 'Convertible' class?

2001-02-07 Thread Marcin 'Qrczak' Kowalczyk
Wed, 7 Feb 2001 15:43:59 -0500, Dylan Thurston [EMAIL PROTECTED] pisze: class Convertible a b where convert :: a - b So, e.g., fromInteger and fromRational could be replaced with convert. (But if you did the same thing with toInteger and toRational as well, you run into problems of

Re: Revamping the numeric classes

2001-02-07 Thread Marcin 'Qrczak' Kowalczyk
Thu, 8 Feb 2001 00:32:18 +0100 (MET), Bjorn Lisper [EMAIL PROTECTED] pisze: Two interpretations of a code are "correct", but one is "more correct" than the other. It is quite similar in spirit to the concept of principal type in Hindley-Milner type systems. An expression can have many

Re: Revamping the numeric classes

2001-02-07 Thread Ketil Malde
Bjorn Lisper [EMAIL PROTECTED] writes: Two interpretations of a code are "correct", but one is "more correct" than the other. It is quite similar in spirit to the concept of principal type in Hindley-Milner type systems. An expression can have many types but only one "best" (most general)

please help me

2001-02-07 Thread FAIZAN RAZA
Hello Please help me to solve this questions Question Cartesian Product of three sets, written as X x Y x Z is defined as the set of all ordered triples such that the first element is a member of X, the second is member of Y, and the thrid member of set Z. write a Haskell function

Problem building ghc-4.08.2: rename/RnHiFiles.hi-boot-5

2001-02-07 Thread Markus Lauer
Hi, Im trying to build ghc-4.08.2 on SuSE Linux 7.0 and get the following error message: rename/RnEnv.lhs:11: Bad interface file: rename/RnHiFiles.hi-boot-5 rename/RnHiFiles.hi-boot-5:3 Interface file parse error; on input ` d ' I got the sources by cvs today. I'm using an

Re: Problem building ghc-4.08.2: rename/RnHiFiles.hi-boot-5

2001-02-07 Thread Reuben Thomas
I'm using an existing ghc-4.08.1 installation to compile. I would have tried to compile with an ghc-4.08.2 compiler build from the x86 HC files, but the donload link for the HC files doesn't work. I've fixed the link; sorry about that. -- http://sc3d.org/rrt/ | RSA, n. safety in numbers

Re: GHC-4.08.2

2001-02-07 Thread Reuben Thomas
Malcolm Wallace [EMAIL PROTECTED] wrote, The original haskell.org site seems ok, just mirror.ac.uk is broken. Oops, retract that. The RedHat 6 packages all seem to be 4.08.1, not the advertised 4.08.2. There shouldn't be any links to RedHat 6 packages. We're providing the links for

Re: GHC-4.08.2

2001-02-07 Thread Manuel M. T. Chakravarty
Reuben Thomas [EMAIL PROTECTED] wrote, packages for it. If you have a RedHat 6.x box with an older version of GHC already installed, just run rpm --rebuild ghc-4.08.2-1.src.rpm This will only work if you install RPM 4, no? I couldn't find a way to make RPM 4 produce v3 RPMs,

Re: GHC-4.08.2

2001-02-07 Thread Marcin 'Qrczak' Kowalczyk
Thu, 08 Feb 2001 17:09:19 +1100, Manuel M. T. Chakravarty [EMAIL PROTECTED] pisze: This will only work if you install RPM 4, no? True. I didn't know whether the src.rpm format also changed. AFAIK it did not change. -- __(" Marcin Kowalczyk * [EMAIL PROTECTED] http://qrczak.ids.net.pl/

Re: Revamping the numeric classes

2001-02-07 Thread Ch. A. Herrmann
moved to haskell-cafe Ketil E.g. way back, I wrote a simple differential equation solver. Ketil Now, the same function *could* have been applied to vector Ketil functions, except that I'd have to decide on how to implement Ketil all the "Num" stuff that really didn't fit well.

Re: Show, Eq not necessary for Num [Was: Revamping the numeric classes]

2001-02-07 Thread Jerzy Karczmarczuk
"Ch. A. Herrmann" answers my questions: Jerzy What do you mean "predefined" operators? Predefined where? In hugs, ":t (*)" tells you: (*) :: Num a = a - a - a which is an intended property of Haskell, I suppose. Aha. But I would never call this a DEFINITION of this operator. This

(no subject)

2001-02-07 Thread Dylan Thurston
___ Haskell-Cafe mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: Revamping the numeric classes

2001-02-07 Thread Marcin 'Qrczak' Kowalczyk
07 Feb 2001 11:47:11 +0100, Ketil Malde [EMAIL PROTECTED] pisze: If it is useful to have a fine granularity of classes, you can imagine doing: class Multiplicative a b c where (*) :: a - b - c Then a*b*c is ambiguous no matter what are types of a,b,c and the

Re: Revamping the numeric classes

2001-02-07 Thread Dylan Thurston
Other people have been making great points for me. (I particularly liked the example of Dollars as a type with addition but not multiplication.) One point that has not been made: given a class setup like class Additive a where (+) :: a - a - a (-) :: a - a - a negate :: a - a zero :: a

Re: Revamping the numeric classes

2001-02-07 Thread andrew
On Wed, Feb 07, 2001 at 11:47:11AM +0100, Ketil Malde wrote: "Ch. A. Herrmann" [EMAIL PROTECTED] writes: [...] the problem is that the --majority, I suppose?-- of mathematicians tend to overload operators. They use "*" for matrix-matrix multiplication as well as for matrix-vector

RE: Revamping the numeric classes

2001-02-07 Thread Peter Douglass
I have some questions about how Haskell's numeric classes might be revamped. Is it possible in Haskell to circumscribe the availability of certain "unsafe" numeric operations such as div, /, mod? If this is not possible already, could perhaps a compiler flag "-noUnsafeDivide" could be added

Re: Revamping the numeric classes

2001-02-07 Thread Tom Pledger
Dylan Thurston writes: : | (A question in the above context is whether the literal '0' should | be interpreted as 'fromInteger (0::Integer)' or as 'zero'. | Opinions?) Opinions? Be careful what you wish for. ;-) In a similar discussion last year, I was making wistful noises about