Re: [Haskell-cafe] HToolkit HSQL on Windows/GHC

2004-03-29 Thread Keith Wansbrough
Another thought, which I hesitate to even mention, would be to call the commandline tool via System.Cmd, pipe the results to a file, and read the file, and parse the results. Slow and ugly, but you could have it working in an hour. Hadn't even thought of that, must be my clean

[Haskell-cafe] dimension of arrays

2004-03-29 Thread Fred Nicolier
Is there a way to get the number of dimension of an array ? i.e. something like : dims :: (Ix a) = Array a b - Int dims = ... a = listArray (1,10) [1,2..] b = listArray ((1,1),(10,10)) [1,2..] dims a -- should be equal to 1 dims b -- should be equal to 2 The key is somewhere in the Ix class but

Re: [Haskell-cafe] HToolkit HSQL on Windows/GHC

2004-03-29 Thread Graham Klyne
At 10:59 29/03/04 +0100, Keith Wansbrough wrote: Another thought, which I hesitate to even mention, would be to call the commandline tool via System.Cmd, pipe the results to a file, and read the file, and parse the results. Slow and ugly, but you could have it working in an hour. Hadn't

RE: [Haskell-cafe] looking for optimization advice

2004-03-29 Thread Simon Marlow
I think that adding the extra check to see if the pointers are identical sped this up enough that it's probably no longer a major issue--I'm pretty certain that the problem was large strings that were identical, so every byte had to be checked, so probably scary non-portable home-made

Re: [Haskell-cafe] dimension of arrays

2004-03-29 Thread Josef Svenningsson
On Mon, 29 Mar 2004, Fred Nicolier wrote: Is there a way to get the number of dimension of an array ? i.e. something like : dims :: (Ix a) = Array a b - Int dims = ... a = listArray (1,10) [1,2..] b = listArray ((1,1),(10,10)) [1,2..] dims a -- should be equal to 1 dims b -- should

Re: [Haskell-cafe] dimension of arrays

2004-03-29 Thread Fred Nicolier
Josef Svenningsson wrote: In a sense Haskell arrays are always one dimensional. But as you noted tuples are used to achieve higher dimensionality. As far as I know there is no way of asking for the dimension of an array. You could write your own class for that though. Here's a suggestion:

[Haskell-cafe] Context for type parameters of type constructors

2004-03-29 Thread Henning Thielemann
Sorry for sending this twice, but it seems to me that the newsgroup fa.haskell only logs the discussion of haskell and haskell-cafe. -- Forwarded message -- Date: Mon, 29 Mar 2004 01:18:27 -0800 From: [EMAIL PROTECTED] (Henning Thielemann) Newsgroups: fa.haskell Subject: Context

Re: [Haskell-cafe] Context for type parameters of type constructors

2004-03-29 Thread MR K P SCHUPKE
Could not deduce (Num a) from the context (VectorSpace VList) The problem is in the definition: zero = VList (repeat 0) Is 0 an Int or an Integer? To define zero, instances need to be parameterised by vector type: EG: class VectorSpace v a where zero :: v a

Re: [Haskell-cafe] Context for type parameters of type constructors

2004-03-29 Thread Dylan Thurston
On Mon, Mar 29, 2004 at 06:00:57PM +0200, Henning Thielemann wrote: Thus I setup a type constructor VectorSpace in the following way: module VectorSpace where class VectorSpace v where zero :: v a add :: v a - v a - v a scale :: a - v a - v a I haven't added