Re: [Haskell-cafe] Norvig's Sudoku Solver in Haskell

2007-08-27 Thread manu
Daniel Fischer's modifications to my original program lead to a 400 % speed boost !!! (It now runs in 22 seconds on my machine) He avoided unecessary calls to 'length', uses Array instead of Map, refactored 'search' function (details below) I've put up his version on hpaste :

Re: [Haskell-cafe] Ideas

2007-08-27 Thread luc.taesch
All went finally fine. wiki is live. thanks for your help. great example. this helped me progressing my understanding of happs. This should conveniently go on the happs tutorial wiki., or at least be referred to . (I have seen alex is doing some tutorial on a wiki in the latest head release,

Re: [Haskell-cafe] Norvig's Sudoku Solver in Haskell

2007-08-27 Thread Jon Harrop
On Monday 27 August 2007 09:09:17 manu wrote: Daniel Fischer's modifications to my original program lead to a 400 % speed boost !!! (It now runs in 22 seconds on my machine) He avoided unecessary calls to 'length', uses Array instead of Map, refactored 'search' function (details below) I've

Re: [Haskell-cafe] Norvig's Sudoku Solver in Haskell

2007-08-27 Thread Daniel Fischer
Am Montag, 27. August 2007 14:40 schrieb Jon Harrop: Probably not, but what's wrong with using arrays (here and in general)? Here I find arrays very natural, after all a grid has a fixed set of indices. And as they have a much faster lookup than maps (not to mention lists), what do you

[Haskell-cafe] Newbie terminology for partial application

2007-08-27 Thread Peter Verswyvelen
A while ago I confused currying with partial application, which was pointed out by members of this community, and the wiki pages got adapted so that newbies like me don't make the same mistake twice ;) That's great. Anyway, at the risk of making mistakes again, I'm looking for good

[Haskell-cafe] quoting in Haskell

2007-08-27 Thread Peter Verswyvelen
In Scheme, on can quote code, so that it becomes data. Microsoft's F# and C# 3.0 also have something similar that turns code into expression trees. The latter is used extensively in LINQ which translates plain C# code into SQL code or any other code at runtime (this idea came from FP I heared)

Re: [Haskell-cafe] Norvig's Sudoku Solver in Haskell

2007-08-27 Thread Chaddaï Fouché
For the translation of the above OCaml code, there is not much to do, in fact it is mostly functional, and so easily translated in Haskell code, note that I add a code to handle input of the form 4.8.5.3..7..2.6.8.4..1...6.3.7.5..2.1.4.., to resolve it and

Re: [Haskell-cafe] quoting in Haskell

2007-08-27 Thread Bas van Dijk
On 8/27/07, Peter Verswyvelen [EMAIL PROTECTED] wrote: In Scheme, on can quote code, so that it becomes data. Microsoft's F# and C# 3.0 also have something similar that turns code into expression trees. The latter is used extensively in LINQ which translates plain C# code into SQL code or any

Re: [Haskell-cafe] quoting in Haskell

2007-08-27 Thread Peter Verswyvelen
Look at Template Haskell. Intuitively Template Haskell provides new language features that allow us to convert back and forth between concrete syntax, i.e. what Gee coming from C++ that was the last thing I expected templates to do. It seems a bit more powerful in Haskell though! I'll look

[Haskell-cafe] Re: [ANN] An efficient lazy suffix tree library

2007-08-27 Thread Gleb Alexeyev
Bryan O'Sullivan wrote: I just posted a library named suffixtree to Hackage. http://www.serpentine.com/software/suffixtree/ It implements Giegerich and Kurtz's lazy construction algorithm, with a few tweaks for better performance and resource usage. API docs:

[Haskell-cafe] Re: Newbie terminology for partial application

2007-08-27 Thread Jon Fairbairn
Peter Verswyvelen [EMAIL PROTECTED] writes: A while ago I confused currying with partial application, which was pointed out by members of this community, and the wiki pages got adapted so that newbies like me don't make the same mistake twice ;) That's great. Anyway, at the risk of making

Re: [Haskell-cafe] Newbie terminology for partial application

2007-08-27 Thread Derek Elkins
On Mon, 2007-08-27 at 16:29 +0200, Peter Verswyvelen wrote: A while ago I confused currying with partial application, which was pointed out by members of this community, and the wiki pages got adapted so that newbies like me don't make the same mistake twice ;) That's great. Anyway, at the

Re: [Haskell-cafe] quoting in Haskell

2007-08-27 Thread Derek Elkins
On Mon, 2007-08-27 at 17:56 +0200, Peter Verswyvelen wrote: Look at Template Haskell. Intuitively Template Haskell provides new language features that allow us to convert back and forth between concrete syntax, i.e. what Gee coming from C++ that was the last thing I expected templates to

Re: [Haskell-cafe] Geometry

2007-08-27 Thread Arie Groeneveld
Steve Schafer wrote: x = a - sqrt(a^2 - b^2) I don't know offhand if there's a straightforward way to arrive at this result without using trigonometry. Here you go, though with a slightly different result (same as Joel Koerwer): a^2=(b^2)/4+(a-x)^2 (Pythagoras) solving x: -- x(1,2) = a

Re: [Haskell-cafe] quoting in Haskell

2007-08-27 Thread Bas van Dijk
On 8/27/07, Derek Elkins [EMAIL PROTECTED] wrote: ...Really, it's not all that appropriate a name anyway... Indeed, Meta Haskell would be better I think. Bas ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] Geometry

2007-08-27 Thread Arie Groeneveld
Correction stefan a b = a - a * sqrt (1 - b*b / a*a) should be: stefan a b = a - a * sqrt (1 - b*b / (a*a)) *Main stefan 10 8 4.0 (0.01 secs, 524896 bytes) Thanks @@i ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] Norvig's Sudoku Solver in Haskell

2007-08-27 Thread manu
From: Daniel Fischer Thought it was something like that. Must check whether that beats Norvig's constraint propagation. it does ! on my machine : Jon Harrop's : 12.5 sec and Norvig's : 15 sec Manu ___ Haskell-Cafe mailing list

Re: [Haskell-cafe] quoting in Haskell

2007-08-27 Thread Dan Piponi
On 8/27/07, Peter Verswyvelen [EMAIL PROTECTED] wrote: Look at Template Haskell. Gee coming from C++ that was the last thing I expected templates to do. It seems a bit more powerful in Haskell though! There's much in common between C++ template metaprogramming and template Haskell - they

[Haskell-cafe] Re: [ANN] An efficient lazy suffix tree library

2007-08-27 Thread ChrisK
Gleb Alexeyev wrote: Bryan O'Sullivan wrote: I just posted a library named suffixtree to Hackage. http://www.serpentine.com/software/suffixtree/ It implements Giegerich and Kurtz's lazy construction algorithm, with a few tweaks for better performance and resource usage. API docs:

Re: [Haskell-cafe] Geometry

2007-08-27 Thread Steve Schafer
On Mon, 27 Aug 2007 19:05:06 +0200, you wrote: Where do I go wrong (I)? b is defined to be _half_ of the chord (the semichord, I suppose). You're assuming it to be the entire chord. Steve Schafer Fenestra Technologies Corp. http://www.fenestra.com/

[Haskell-cafe] [ANN] pcap 0.3.1, for user-level network packet capture

2007-08-27 Thread Bryan O'Sullivan
I've taken over maintenance of the pcap library (an interface to libpcap, for user-level network packet capture), and released a new version. Home page: http://www.serpentine.com/software/pcap/ API docs: http://darcs.serpentine.com/pcap/dist/doc/html/pcap/ Download:

[Haskell-cafe] Re: [ANN] An efficient lazy suffix tree library

2007-08-27 Thread Bryan O'Sullivan
ChrisK wrote: That is almost certainly because the algorithm expects the source string to have a unique character at its end. Chris is correct. I'll ensure that the docs make this clear. b ___ Haskell-Cafe mailing list

Re: [Haskell-cafe] Geometry

2007-08-27 Thread Chaddaï Fouché
2007/8/27, Steve Schafer [EMAIL PROTECTED]: b is defined to be _half_ of the chord (the semichord, I suppose). You're assuming it to be the entire chord. Based on the drawing I thought it was the length of the arc (in blue) ? -- Jedaï ___

[Haskell-cafe] Re: quoting in Haskell

2007-08-27 Thread Rene de Visser
Peter Verswyvelen [EMAIL PROTECTED] schrieb im Newsbeitrag news:[EMAIL PROTECTED] In Scheme, on can quote code, so that it becomes data. Microsoft's F# and C# 3.0 also have something similar that turns code into expression trees. The latter is used extensively in LINQ which translates plain

Re: [Haskell-cafe] Norvig's Sudoku Solver in Haskell

2007-08-27 Thread Daniel Fischer
Am Montag, 27. August 2007 10:09 schrieb manu: Daniel Fischer's modifications to my original program lead to a 400 % speed boost !!! (It now runs in 22 seconds on my machine) He avoided unecessary calls to 'length', uses Array instead of Map, refactored 'search' function (details below)

Re: [Haskell-cafe] quoting in Haskell

2007-08-27 Thread Jeremy Shaw
At Mon, 27 Aug 2007 17:04:17 +0200, Peter Verswyvelen wrote: In Scheme, on can quote code, so that it becomes data. Microsoft's F# and C# 3.0 also have something similar that turns code into expression trees. The latter is used extensively in LINQ which translates plain C# code into SQL

Re: [Haskell-cafe] Geometry

2007-08-27 Thread Peter Verswyvelen
The author of the question (Tony Morris) actually asked two different questions, and so people gave two different replies :) To quote Tony: "I may have misunderstood his problem (we were drawing in dirt) and actually, it is the straight line between the two points on the circumference that

[Haskell-cafe] No Enum nor Ix instance on Graphics.UI.GLUT.Key

2007-08-27 Thread Peter Verswyvelen
I want to make an array using GLUT.Key as an index, but it is not an instance of Enum nor Ix Of course, I can make it an instance myself, but I guess it would be easier to do so in the library? Cheers, Peter ___ Haskell-Cafe mailing list