[Haskell-cafe] Overlapping Instances with Functional Dependencies

2005-07-08 Thread Martin Sulzmann
Hi, I wouldn't call this a bug, overlapping instances and in particular the combination with functional dependencies are something which is not well studied yet. Hence, GHC is very conservative here. I feel like you, this program should work. As you correctly point out, there's a conflict among

RE: [Haskell-cafe] Overlapping Instances with Functional Dependencies

2005-07-08 Thread Simon Peyton-Jones
Martin's dead right. GHC uses a less sophisticated mechanism to do matching when it's thinking about functional dependencies than when it's doing straight instance matching. Maybe something cleverer for fundeps would make sense, as you point out. I hadn't thought of that before; it's a good

RE: [Haskell-cafe] Overlapping Instances with Functional Dependencies

2005-07-08 Thread Martin Sulzmann
Simon's dead right, too :) The issue raised here is of general nature and doesn't depend on the particular (syntactic) formalism used to specify type dependencies (let it be FDs, ATs,...). The consequence is that instances and type dependencies are closer linked to each other then one might think

Re: [Haskell-cafe] matrix computations based on the GSL

2005-07-08 Thread Alberto Ruiz
The server is working again. On Thursday 07 July 2005 20:58, Alberto Ruiz wrote: I' sorry, our web server is temporarily down :-( http://dis.um.es/~alberto/hmatrix/matrix.html ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] matrix computations based on the GSL

2005-07-08 Thread Henning Thielemann
On Fri, 8 Jul 2005, Alberto Ruiz wrote: The server is working again. On Thursday 07 July 2005 20:58, Alberto Ruiz wrote: I' sorry, our web server is temporarily down :-( http://dis.um.es/~alberto/hmatrix/matrix.html I would remove the 'matrix' portions of the function names, since

Re: [Haskell-cafe] matrix computations based on the GSL

2005-07-08 Thread Henning Thielemann
On Thu, 7 Jul 2005, Alberto Ruiz wrote: Hello! Thank you very much for all your suggestions. A new version of the library can be found at: http://dis.um.es/~alberto/hmatrix/matrix.html If the Matrix type would be parametrised then Matrix.fromBlocks could use a more natural indexing.

Re: [Haskell-cafe] Confused about Cyclic struture

2005-07-08 Thread Dinh Tien Tuan Anh
So is sharing already implemented in Haskell ? Do i have to use where clause to implement the sharing ? Thanks a lot for your help Cheers To understand cyclic structures it is useful to think of graph reduction, because these graphs allow us to conveniently represent sharing between

Re: [Haskell-cafe] matrix computations based on the GSL

2005-07-08 Thread David Roundy
On Thu, Jul 07, 2005 at 03:08:50PM +0200, Henning Thielemann wrote: On Thu, 7 Jul 2005, David Roundy wrote: On Tue, Jul 05, 2005 at 08:17:58PM +0200, Henning Thielemann wrote: The example, again: If you write some common expression like transpose x * a * x then both the human

Re: [Haskell-cafe] matrix computations based on the GSL

2005-07-08 Thread Keean Schupke
Henning Thielemann wrote: My objections to making everything a matrix were the objections I sketched for MatLab. The example, again: If you write some common expression like transpose x * a * x Which just goes to show why haskell limits the '*' operator to multiplying the same types. Keep

Re: [Haskell-cafe] matrix computations based on the GSL

2005-07-08 Thread Henning Thielemann
On Thu, 7 Jul 2005, David Roundy wrote: On the other hand, this is sort of a silly debate, since the API *I* want is a subset of the API *you* want. The API you want is certainly not just a subset of what I want. E.g. the singular value decomposition in your favorite API will probably return

Re: [Haskell-cafe] matrix computations based on the GSL

2005-07-08 Thread Henning Thielemann
On Fri, 8 Jul 2005, Alberto Ruiz wrote: The server is working again. On Thursday 07 July 2005 20:58, Alberto Ruiz wrote: I' sorry, our web server is temporarily down :-( http://dis.um.es/~alberto/hmatrix/matrix.html I would also prefer a vector of complex numbers for the FFT

Re: [Haskell-cafe] matrix computations based on the GSL

2005-07-08 Thread Keean Schupke
Henning Thielemann wrote: Let me elaborate on that: In some cases putting vectors as columns into a matrix then applying a matrix operation on this matrix leads to the same like to 'map' a matrix-vector operation to a list of vectors. But in other cases (as the one above) this is not what you

Re: [Haskell-cafe] matrix computations based on the GSL

2005-07-08 Thread Henning Thielemann
On Fri, 8 Jul 2005, Keean Schupke wrote: Henning Thielemann wrote: My objections to making everything a matrix were the objections I sketched for MatLab. The example, again: If you write some common expression like transpose x * a * x Which just goes to show why haskell limits the

Re: [Haskell-cafe] matrix computations based on the GSL

2005-07-08 Thread Henning Thielemann
On Fri, 8 Jul 2005, Keean Schupke wrote: Okay, this approach is starting to make sense to me... I can see now that Vectors are a different type of object to Matrices. Vectors represent points in N-Space and matrices represent operations on those points That's what I wanted to express.

Re: [Haskell-cafe] matrix computations based on the GSL

2005-07-08 Thread Keean Schupke
Henning Thielemann wrote: I'm excited if your code gets swamped by conversions between Double and Matrix then. I really plead for representing everything with strings, this is the most simple and most flexible solution! :-] Surely its a case of balancing the advantage of type safety against

Re: [Haskell-cafe] matrix computations based on the GSL

2005-07-08 Thread Keean Schupke
Henning Thielemann wrote: Do you mean [x,y,z,1] * [[1,0,0,0],[0,1,0,0],[0,0,1,0],[dx,dy,dz,dw+1]] ? Erm, yes thats what I meant ... but you obviously got the point. but how is this different from adding vectors? If we allow vector addition then we no longer have the nice separation

Re: [Haskell-cafe] matrix computations based on the GSL

2005-07-08 Thread David Roundy
On Fri, Jul 08, 2005 at 03:33:16PM +0200, Henning Thielemann wrote: On Thu, 7 Jul 2005, David Roundy wrote: On the other hand, this is sort of a silly debate, since the API *I* want is a subset of the API *you* want. The API you want is certainly not just a subset of what I want. E.g.

[Haskell-cafe] Re: matrix computations based on the GSL

2005-07-08 Thread Keean Schupke
Is a matrix is a linear operation on a vector, does it not make sense to define matrix applicaion: mapply :: Matrix - Vector - Vector Then you can define say: rotate90 = mapply rotationMatrix90 v' = rotate90 v Keean. ___ Haskell-Cafe

Re: [Haskell-cafe] matrix computations based on the GSL

2005-07-08 Thread Henning Thielemann
On Fri, 8 Jul 2005, Keean Schupke wrote: Henning Thielemann wrote: Do you mean [x,y,z,1] * [[1,0,0,0],[0,1,0,0],[0,0,1,0],[dx,dy,dz,dw+1]] ? Erm, yes thats what I meant ... but you obviously got the point. but how is this different from adding vectors? If we allow vector addition

Re: [Haskell-cafe] matrix computations based on the GSL

2005-07-08 Thread Keean Schupke
Henning Thielemann wrote: In general a vector need not to be a linear operator. You talked about vector translation, translation is not a linear operator. You gave some process to map the problem to somewhere, where it becomes a linear operator. Other people said that the scalar product with a

Re: [Haskell-cafe] matrix computations based on the GSL

2005-07-08 Thread Henning Thielemann
On Fri, 8 Jul 2005, David Roundy wrote: I don't particularly care what API you use for svd, since it's trivial to convert from one API to the other. It's matrix arithmetic I care about, since that's the complicated part of the API. Of course I want to use the results of more complicated

[Haskell-cafe] Re: matrix computations based on the GSL

2005-07-08 Thread Henning Thielemann
On Fri, 8 Jul 2005, Keean Schupke wrote: Is a matrix is a linear operation on a vector, It _is_ not a linear map, but it is a canonical representation of a linear map. does it not make sense to define matrix applicaion: mapply :: Matrix - Vector - Vector Then you can define say:

Re: [Haskell-cafe] matrix computations based on the GSL

2005-07-08 Thread Henning Thielemann
On Fri, 8 Jul 2005, Keean Schupke wrote: So the linear operator is translation (ie: + v)... effectively 'plus' could be viewed as a function which takes a vector and returns a matrix (operator) (+) :: Vector - Matrix Since a matrix _is_ not a linear map but only its representation,

Re: [Haskell-cafe] matrix computations based on the GSL

2005-07-08 Thread Keean Schupke
Henning Thielemann wrote: On Fri, 8 Jul 2005, Keean Schupke wrote: So the linear operator is translation (ie: + v)... effectively 'plus' could be viewed as a function which takes a vector and returns a matrix (operator) (+) :: Vector - Matrix Since a matrix _is_ not a linear map

[Haskell-cafe] Re: matrix computations based on the GSL

2005-07-08 Thread Keean Schupke
Henning Thielemann wrote: does it not make sense to define matrix applicaion: mapply :: Matrix - Vector - Vector Then you can define say: rotate90 = mapply rotationMatrix90 v' = rotate90 v ... that's what I said about mulVec. I guess that means we agree... Keean.

Re: [Haskell-cafe] Confused about Cyclic struture

2005-07-08 Thread Dinh Tien Tuan Anh
Another question, it's said in the book that using cyclic structure (like ones = 1:ones) , the list would be represented by a fixed amount of memory. Does it mean [1,1,1..] only occupy one cell of memory ? How about in take 100 [1,1,...] ? From: Dinh Tien Tuan Anh [EMAIL

Re: [Haskell-cafe] Confused about Cyclic struture

2005-07-08 Thread Henning Thielemann
On Fri, 8 Jul 2005, Dinh Tien Tuan Anh wrote: Another question, it's said in the book that using cyclic structure (like ones = 1:ones) , the list would be represented by a fixed amount of memory. Does it mean [1,1,1..] only occupy one cell of memory ? How about in take 100

[Haskell-cafe] Re: matrix computations based on the GSL

2005-07-08 Thread Henning Thielemann
On Fri, 8 Jul 2005, Keean Schupke wrote: Henning Thielemann wrote: does it not make sense to define matrix applicaion: mapply :: Matrix - Vector - Vector Then you can define say: rotate90 = mapply rotationMatrix90 v' = rotate90 v ... that's what I said about

Re: [Haskell-cafe] matrix computations based on the GSL

2005-07-08 Thread Henning Thielemann
On Fri, 8 Jul 2005, Keean Schupke wrote: Henning Thielemann wrote: On Fri, 8 Jul 2005, Keean Schupke wrote: So the linear operator is translation (ie: + v)... effectively 'plus' could be viewed as a function which takes a vector and returns a matrix (operator) (+) :: Vector -

Re: [Haskell-cafe] matrix computations based on the GSL

2005-07-08 Thread Benjamin Franksen
On Friday 08 July 2005 17:46, Henning Thielemann wrote: Vectors can be used and abused for many things but an object which can be called a vector (because of its ability of to be added and to be scaled) is not a linear operator itself and does not naturally represent one. At least for finite