Re: [Haskell-cafe] What Functions are Standard?

2004-10-05 Thread Glynn Clements
John Goerzen wrote: > Hello, > > I have been writing code using the docs over at > http://www.haskell.org/ghc/docs/latest/html/libraries/index.html, which > is the only comprehensive library reference I could find. > > I am using some code from System.IO, supposedly from base. When I try > to

[Haskell-cafe] What Functions are Standard?

2004-10-05 Thread John Goerzen
Hello, I have been writing code using the docs over at http://www.haskell.org/ghc/docs/latest/html/libraries/index.html, which is the only comprehensive library reference I could find. I am using some code from System.IO, supposedly from base. When I try to build this with nhc98, it doesn't know

Re: [Haskell-cafe] Space leaks

2004-10-05 Thread William Lee Irwin III
On Wed, Oct 06, 2004 at 12:27:35PM +1000, Ben Lippmeier wrote: > Now imagine that state is some large structure. The [x] list is a couple > of hundred elements long, and you print out some -> but not all <- of > the [y] elements. While the [y] list remains live, a whole collection of > half eva

[Haskell-cafe] Tutorial about low-level I/O in Haskell

2004-10-05 Thread Peter Simons
Hi, while polishing a small library of mine, I ended up writing a tutorial about the use of hGetBufNonBlocking and the related Foreign.* functions you need to do fast, block-oriented I/O in Haskell. There is something to be said for literate programming. Using recent topics for inspiration, the t

Re: [Haskell-cafe] Space leaks

2004-10-05 Thread Ben Lippmeier
In my experience, any time your program makes use of some state-like structure which gets updated over a number of iterations, you're going to be in trouble with space leaks. There's a library function which summarises this nicely, mapAccumL :: (state -> x -> (state, y)) -> state -> [x] -> (stat

Re: [Haskell-cafe] Integrating Haskell into a J2EE environment

2004-10-05 Thread Doug Kirk
You're going to spend alot of time marshalling between Java and Haskell values, and you'll either have to do it via JNI or by using pipes [as in System.exec("haskellprogram param param param")], both of which are ugly for a Java app. Have you looked at Jython and JRuby? Jython is an implementat

[Haskell-cafe] Integrating Haskell into a J2EE environment

2004-10-05 Thread Bhinderwala, Shoeb
Hi All, I am new to Haskell and this mailing list. We have a system that uses a custom high-level language to express high-level business rules. Expressions in the high-level language get compiled to Java bytecode. We express the grammar using BNF notation as required by the javacc parser tool.

Re: [Haskell-cafe] Including registered packages for GHC using Eclipse

2004-10-05 Thread Geoff C
Thanks, Leif! Thank you for the fast response. It took me a few times, trying different things, but I got your instructions to work. I am totally new to Eclipse. Tried importing ghcCompiler, making the change, saving, and copying jar file. No luck. Went through a few iterations, but found suc

Re: [Haskell-cafe] OCaml list sees abysmal Language Shootout results

2004-10-05 Thread Greg Buchholz
Keith Wansbrough wrote: > I just saw this on the OCaml list (in a posting by "Rafael 'Dido' > Sevilla" <[EMAIL PROTECTED]> in the "Observations on OCaml vs. Haskell" > thread). I can't believe that a simple "wc" implementation should be > 570 times slower in Haskell than OCaml - could someone i

[Haskell-cafe] Space leaks (was: How do I get a long iteration to run in constant space)

2004-10-05 Thread Graham Klyne
I've been starting to take note of discussion about space leaks in Haskell. So far, it's not a topic that's bothered me, other than obvious programming errors, and I've never found the need to force strict evaluation of my Haskell programs. I find myself wondering why this is. Your comment ab

Re: [Haskell-cafe] Exceptions

2004-10-05 Thread Keith Wansbrough
[+RTS -xc] > A major problem with this that I notice is that it dumps the stack > whenever any exception is raised, which is a big pain if your program > does IO and regularly raises and catches exceptions as part of normal > operation. A big improvement would be to only dump the backtrace if the >

[Haskell-cafe] Re: How do I get a long iteration to run in constant space

2004-10-05 Thread oleg
I added two lines to your code: iterate2 f x n | seq f $ seq x $ seq n $ False = undefined iterate2 f x n = --- as before rk4Next f h (x, y) | seq f $ seq h $ seq x $ seq y $ False = undefined rk4Next f h (x, y) = -- as before I also increased ten times the number of steps for the last iteratio