Re: [Haskell-cafe] performance question

2005-01-18 Thread John Meacham
On Mon, Jan 17, 2005 at 08:54:38PM -0800, Ben Rudiak-Gould wrote: > If performance is the main concern, I would flatten the data structure: > >data Interval = IlII Double Double > | IlIE Double Double > | IlEI Double Double > | IlEE Double Dou

Re: [Haskell-cafe] Unit testing in Haskell

2005-01-18 Thread Graham Klyne
I use hunit, and find it works very well. #g -- At 20:05 11/01/05 +0100, Dmitri Pissarenko wrote: Hello! When programming in an imperative language like Java, unit tests are a very important development tool IMHO. I want to try out unit testing in Haskell and wonder what experienced Haskellers thi

[Haskell-cafe] RE: Answers to Exercises in Craft of FP

2005-01-18 Thread David Owen
Gour ([EMAIL PROTECTED]) wrote RE- : Do you know if there are solutions to exersises available somewhere? Have you gone through the whole book, i.e. all the exercises? Sincerely, Gour Hi Gour, Unfortuantely I don't know of anywhere that the exercise answers can be found, even after some google sea

[Haskell-cafe] Math libraries for Haskell

2005-01-18 Thread Dmitri Pissarenko
Hello! Is there a math library for Haskell, using which one can calculate eigenvalues of matrices? Thanks in advance Dmitri Pissarenko -- Dmitri Pissarenko Software Engineer http://dapissarenko.com ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] Math libraries for Haskell

2005-01-18 Thread Sebastian Sylvan
On Tue, 18 Jan 2005 20:25:46 +0100, Dmitri Pissarenko <[EMAIL PROTECTED]> wrote: > Hello! > > Is there a math library for Haskell, using which one can calculate eigenvalues > of matrices? > > Thanks in advance > Are you interested in seeing Haskell implementation of these algorithms, or are you

Re: [Haskell-cafe] Math libraries for Haskell

2005-01-18 Thread John Meacham
On Tue, Jan 18, 2005 at 08:25:46PM +0100, Dmitri Pissarenko wrote: > Hello! > > Is there a math library for Haskell, using which one can calculate eigenvalues > of matrices? There is a binding to BLAS/LAPACK at http://www.isi.edu/~hdaume/HBlas/ but it might be too heavyweight for just calculating

Re: [Haskell-cafe] Math libraries for Haskell

2005-01-18 Thread Dmitri Pissarenko
Are you interested in seeing Haskell implementation of these algorithms, or are you interested in using eignevalues in some Haskell program? I am interested in using eigenvalues in a Haskell program. This seems like a perfect candidate for using FFI if you're just looking for fast eigenvalue comput

Re: [Haskell-cafe] Math libraries for Haskell

2005-01-18 Thread Keean Schupke
Can I request 2 types, one for dense (complete) matricies and another for sparse matricies? This suggests to me that a library of matrix operations should be a set of classes that allow instances to be declared for different implementations. Keean. John Meacham wrote: A standard matrix represent

Re: [Haskell-cafe] Math libraries for Haskell

2005-01-18 Thread Sebastian Sylvan
On Tue, 18 Jan 2005 20:41:28 +0100, Dmitri Pissarenko <[EMAIL PROTECTED]> wrote: > > Are you interested in seeing Haskell implementation of these > > algorithms, or are you interested in using eignevalues in some Haskell > > program? > > I am interested in using eigenvalues in a Haskell program. >

[Haskell-cafe] About instance

2005-01-18 Thread Ulises Juarez Martinez
Hi. I have the next definitions: type Ocurrence = (String, Int) type Inside = [Ocurrence] data Pattern = Return Inside | Abort | Filter (Ocurrence -> Bool) Pattern beyond :: Pattern -> Pattern beyond (Filter pred Abort) = Abort -- more definitions of beyond optimous :: Pattern -> Pattern optimous

Re: [Haskell-cafe] About instance

2005-01-18 Thread Jules Bean
On 18 Jan 2005, at 21:45, Ulises Juarez Martinez wrote: Who can I do an instance of Eq (Ocurrence -> Bool)? Is there another option to avoid the error? In general, you can't define one. To define equality on functions you want to check the value on every possible input, and since Ocurrence is a

Re: [Haskell-cafe] Re: Hugs vs GHC (again)was: Re: Somerandomnewbiequestions

2005-01-18 Thread Glynn Clements
Ben Rudiak-Gould wrote: > >Actually, If I were writing new haskell libraries, I would use mmap > >whenever I could for accessing files. not only does it make the file > >pointer problem go away, but it can be drastically more efficient. > > I'm not sure this is a good idea, because GHC really

[Haskell-cafe] Re: Why is getArgs in the IO monad?

2005-01-18 Thread Ashley Yakeley
In article <[EMAIL PROTECTED]>, Keean Schupke <[EMAIL PROTECTED]> wrote: > Surely both requirements can be satisfied if the programs arguments are made > parameters of main: > > main :: [String] -> IO () > > Keean. Better yet, it should be an implicit parameter so as not to break existing

Re: [Haskell-cafe] Re: Hugs vs GHC (again)was: Re: Somerandomnewbiequestions

2005-01-18 Thread Duncan Coutts
On Tue, 2005-01-18 at 22:52 +, Glynn Clements wrote: > Ben Rudiak-Gould wrote: > Essentially, reading data from regular files is always deemed to occur > "soon", so the usual mechanisms for dealing with "slow" I/O (i.e. > pipes, FIFOs, character devices, sockets) don't work. This applies > eq

[Haskell-cafe] Re: [Haskell] Re: Why is getArgs in the IO monad?

2005-01-18 Thread Marcin 'Qrczak' Kowalczyk
Keean Schupke <[EMAIL PROTECTED]> writes: > Surely both requirements can be satisfied if the programs arguments are made > parameters of main: > > main :: [String] -> IO () >From info '(libc)Error Messages', about program_invocation_name and program_invocation_short_name: *Portability Note:*

Re: [Haskell-cafe] Re: Books on Haskell

2005-01-18 Thread Matthew Roberts
Haskell wiki pages for this stuff? I presume you would need the authors/publishers permission. I am 62 pages into "Implementing Functional Languages: a tutorial" and would be happy to put up the solutions I have so far (with appropriate permission of course). The advantage of the wiki is that

[Haskell-cafe] styles

2005-01-18 Thread Matthew Roberts
Haskell seems to be a language that allows for lots of different programming styles. The most obvious being pointed v.s. point free. As a programmer born and raised on OO - I have found the pointed style to suit me better. However, there are other distinctions. I heavily use "let in" and "wh

Re: [Haskell-cafe] styles

2005-01-18 Thread padiolea
> Haskell seems to be a language that allows for lots of different > programming styles. The most obvious being pointed v.s. point free. > > As a programmer born and raised on OO - I have found the pointed style > to suit me better. As a programmer born fp but that like oo too, I prefer to define

Re: [Haskell-cafe] Re: Hugs vs GHC (again)was: Re: Somerandomnewbiequestions

2005-01-18 Thread Ben Rudiak-Gould
Glynn Clements wrote: >Ben Rudiak-Gould wrote: > >>GHC really needs non-blocking >>I/O to support its thread model, and memory-mapped I/O always blocks. > >If, by "blocks", you mean that execution will be suspended until the >data has been read from the device into the buffer cache, then Unix >non-

[Haskell-cafe] Re: performance question (John Meacham)

2005-01-18 Thread Stijn De Saeger
thanks Ben and John, your ideas looked like they may speed up things indeed, so i went along with them and reimplemented the whole thing to my surprise, the program got considerably slower even ! here is the new code. > data ILtype = II | IE | EI | EE | NII | NIE | NEI | NEE deriving (Eq, O