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 cartesianPr

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 g

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 m

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 probl

`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 alge

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

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 genera

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 lengt

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 > > 'Con

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

'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 yo

Re: Fundeps and quantified constructors

2001-02-07 Thread Marcin 'Qrczak' Kowalczyk
Wed, 7 Feb 2001 01:32:38 -0800 (PST), anatoli <[EMAIL PROTECTED]> pisze: > > data Foo a = (Eq a) => MkFoo a What do you mean by this? What is the difference between that and data Foo a = MkFoo a except that the latter is more general? > The same error message is given for > > > data Foo a

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 well-

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 possibiliti

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 _

New PhD Positions in Computing Science, Gothenburg, Sweden

2001-02-07 Thread Reiner Haehnle
Please pass on to interested students. Apologies for multiple copies. - New PhD Positions (DEADLINE 1 March 2001! See "How to apply" below.) Department of Computing Science, Chalmers University of Techn

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

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 > ha

8th Static Analysis Symposium : Last CFP

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

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 addi

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 Bjorn Lisper
Dylan Thurston: >Andreas Gruenbacher: >> It may be the case that using (*) for scaling too is a generally bad >> idea... >It may not be type sound to have the same operation, but there should >be some standard operation for scaling. (Probably you need >multi-parameter type classes for this.) I'

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.

names, modules, types

2001-02-07 Thread Johannes Waldmann
> import Handle as H > > H.getLine > > (This is a good example where type classes would not help > making this any better, since the types of getLine and > H.getLine are very different.) not too different, I think; static overloading would help. Just allow to have two (or more) identifiers

Re: Revamping the numeric classes

2001-02-07 Thread Ketil Malde
Brian Boutel <[EMAIL PROTECTED]> writes: > * most usage of (+), (-), (*) is on numbers which support all of them. Yes, but the problem is that the way this is implemented is a nuisance and a hindrance to those who wants to apply these operators to different data types. Also, it means functions

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 rep