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
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
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
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
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
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
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
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
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
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
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
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
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-
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
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
_
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
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
[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
My apologies for duplicates of this announcement=
=
= =
=Call For Papers=
=
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
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 '
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'
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.
> 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
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
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
26 matches
Mail list logo