Re: [Haskell-cafe] saner shootout programs

2008-05-13 Thread J C
On Mon, May 12, 2008 at 4:38 AM, Richard Kelsall <[EMAIL PROTECTED]> wrote: > Hello JC, I think you've set yourself a challenge there :) Welcome to > Haskell programming. Taking a Shootout entry and playing with it is > a great way to learn Haskell. The Shootout provides an example in your > f

Re: [Haskell-cafe] saner shootout programs

2008-05-11 Thread J C
On Sun, May 11, 2008 at 1:40 PM, Don Stewart <[EMAIL PROTECTED]> wrote: > n-body requires updating a global array of double values to be I think the array and any side-effects on it can and should be local to the simulation procedure. > competitive performance-wise, though we haven't really nail

[Haskell-cafe] saner shootout programs

2008-05-11 Thread J C
I don't know Haskell very well, but even I can tell, looking at, for example, the N-body benchmark, that the Haskell code is probably not type-safe, and the tricks used in it would not be usable in a larger program (see below). The task is essentially a pure computation: take a list of bodies havi

Re: List comprehensions

2003-01-30 Thread Rijk J. C. van Haaften
* Rijk J. C. van Haaften <[EMAIL PROTECTED]> [2003-01-30 11:41 +0100]: > Recently, I came accross this expression: > [ x + y | x <- xs | y <- ys ] ^ Put a comma ',' here. That's something totally different. Two example

List comprehensions

2003-01-30 Thread Rijk J. C. van Haaften
Hello, Recently, I came accross this expression: [ x + y | x <- xs | y <- ys ] As far as I can see (Haskell Report), this is not allowed by the haskell 98 standard. So I assume it to be an ex- tension. Where can I find information about this? Thanks, Rijk __

Re: Binary search tree

2002-04-29 Thread Rijk J. C. van Haaften
>Hi everybody, > >I studied haskell this semester at the university and I was required to >implement a binary search tree in haskell. >I would appreciate if anyone could send me an example code of this data >structure. Just read a standard textbook. Some useful course notes by Jeroen Fokker are

Re: hashmap withdrawal and poor haskell style

2002-04-03 Thread Rijk J. C. van Haaften
At 13:27 03-04-02 +0100, D. Tweed wrote: >On Wed, 3 Apr 2002, Michal Wallace wrote: > > > module Main where > > alphabet = "abcdefghijklmnopqrstuvwxyz" > > count ch str = length [c | c <- str , c == ch] > > hist str = [count letter str | letter <- alphabet] > > oneline ch str = [ch

Rectification Hugs bug

2002-03-07 Thread Rijk J. C. van Haaften
Dear all, After intensive investication of several people here at Utrecht University, these are the results 1. The very latest Hugs version doesn't have the bug 2. All before-december-2001 versions don't have the bug I were using a version downloaded some weeks ago. After installing the curr

Bug in Hugs Dec 2001: type inferencer incorrect!

2002-03-06 Thread Rijk J. C. van Haaften
Hello everybody, Although I didn't manage to reproduce the bug with a minimal example, I think it is still important enough to tell you (and especially the Hugs writers and maintainers). Yesterday evening, I tried to add some correct (!) code (by-hand-verifyable; by GHC accepted; just using plai

Re: Ground Up

2002-02-28 Thread Rijk J. C. van Haaften
Jerry wrote >However, my problems are: >* I still don't understand most of the codes I found, like the various > haskell libraries Practice is the only answer to this problem, as Keith Wansbrough says. >* I still have no clue of most (ok, almost all) of what is being > discussed in this mail

Re: Help

2002-02-25 Thread Rijk J. C. van Haaften
You probably want to do something like this: main = do { contents <- input "twoboxes.dat" return (control (parser contents)) } At 11:53 25-02-02 -0300, Juan M. Duran wrote: >Hi, I'm writting a small parser in Haskell and, when it is all done, I get >the following prob