[Haskell-cafe] Selecting overlapping instances

2007-02-22 Thread Emil Axelsson
Hello! I have a problem with overlapping instances for which I already know a workaround. However, I'm still curious to know if there isn't a simpler solution available. I have a feeling that -fallow-incoherent-instances might be the answer, but I can't get it to work. In the code at the

Re: [Haskell-cafe] Code and Perf. Data for Prime Finders (was: Genuine Eratosthenes sieve)

2007-02-22 Thread Joe Thornber
On 22/02/07, Melissa O'Neill [EMAIL PROTECTED] wrote: But talk is cheap. What about some actual numbers, and some code for some actual implementations...? Perhaps you could go the last 1% and upload a Primes package to Hackage and forever save us from inferior sieves ? (I enjoyed your paper

Re: [Haskell-cafe] Leaves of a Tree

2007-02-22 Thread Yitzchak Gale
Tom Hawkins wrote: Any recommendations for speeding up extracting the set of leaves from a tree? Tom, The standard library already has this, in Data.Tree and Data.Foldable.toList. I'm interested to know how well that performs compared to the roll-your-own solutions proposed so far in this

[Haskell-cafe] Re: Leaves of a Tree

2007-02-22 Thread apfelmus
Tom Hawkins wrote: Any recommendations for speeding up extracting the set of leaves from a tree? data Tree = Branch Tree Tree | Leaf Int deriving (Eq, Ord) My slow, naive function: leaves :: Tree - Set Int leaves (Leaf n) = singleton n leaves (Branch left right) = union (leaves left)

[Haskell-cafe] Re: Debugging concurrent program - no threads apparently running, but RTS still doing something.

2007-02-22 Thread Simon Marlow
Alistair Bayley wrote: Below is a test case for a threading problem I can't figure out. It models a socket server (here I've replaced the socket with an MVar, to keep it simple). The idea is to have a listener which accepts incoming requests on the socket. When one arrives, it forks a handler

[Haskell-cafe] Re: Debugging concurrent program - no threads apparently running, but RTS still doing something.

2007-02-22 Thread Alistair Bayley
The problem is that when the main thread ends, the RTS doesn't stop for another 6 or so seconds. The only thread that runs this long is the handler (waitFor (secs 8.0)) but it has already been killed. So I'm scratching my head a bit. Short answer: use -threaded. The runtime is waiting for a

Re: [Haskell-cafe] Re: functional database queries

2007-02-22 Thread Henning Thielemann
On Wed, 21 Feb 2007 [EMAIL PROTECTED] wrote: Albert Y. C. Lai wrote: [EMAIL PROTECTED] wrote: Albert Y. C. Lai wrote: If and only if the database is a purely functional immutable data structure, this can be done. [...] Many interesting databases are not purely functional immutable;

[Haskell-cafe] Re: functional database queries

2007-02-22 Thread apfelmus
Henning Thielemann wrote: In other words, 'Query a' just assembles a valid SQL-string, it does not query or execute anything. Of course, instead of the DSEL approach don't execute anything, only construct a program in a foreign language which does that it would be nice to have a database

[Haskell-cafe] process

2007-02-22 Thread h .
Hello, I need to interact with some other program, and wrote the following code: module Main where import System.Process import System.IO main :: IO () main = do putStrLn Running proc9... (inp,out,err,pid) - runInteractiveProcess prog1 [] Nothing Nothing hSetBuffering

[Haskell-cafe] Prime finding

2007-02-22 Thread Ruben Zilibowitz
I see that there has been some discussion on the list about prime finding algorithms recently. I just wanted to contribute my own humble algorithm: primes :: [Integer] primes = primesFilter 1 [2..] primesFilter :: Integer - [Integer] - [Integer] primesFilter primorial (n:ns) | (gcd

Re: [Haskell-cafe] TFP 2007: Registration and Program

2007-02-22 Thread Seth Gordon
TFP 2007 wrote: Dear Colleagues, You may now resgister for TFP 2007! TFP 2007 will be held April 2-4, 2007 in New York City, USA. Aaargh! April 2 is the first night of Passover. This is not one of those obscure holidays whose names are Hebrew for alternate-side parking suspended[*]; a

Re: [Haskell-cafe] TFP 2007: Registration and Program

2007-02-22 Thread Murray Gross
On Thu, 22 Feb 2007, Seth Gordon wrote: TFP 2007 wrote: Dear Colleagues, You may now resgister for TFP 2007! TFP 2007 will be held April 2-4, 2007 in New York City, USA. Aaargh! April 2 is the first night of Passover. This is not one of those obscure holidays whose names are Hebrew

Re: [Haskell-cafe] Re: Haskell vs Ruby as a scripting language

2007-02-22 Thread Malcolm Wallace
[EMAIL PROTECTED] (Donald Bruce Stewart) wrote: The two where nhc98 wins are due to nhc98 producing the wrong output. The testsuite doesn't diff the output yet.. Only one of those gives the wrong output (spectral/integer). The other (spectral/calendar) looks right to me. Interestingly, when

Re: [Haskell-cafe] TFP 2007: Registration and Program

2007-02-22 Thread Seth Gordon
I assume that there is no way to change the date for *this* conference; it would require renegotiating agreements and rejuggling schedules with too many actors (hotels, restaurants, important speakers, etc.). But I would like everyone involved in planning *future* conferences to keep this

Re: [Haskell-cafe] Prime finding

2007-02-22 Thread Stephen Forrest
On 2/22/07, Ruben Zilibowitz [EMAIL PROTECTED] wrote: I see that there has been some discussion on the list about prime finding algorithms recently. I just wanted to contribute my own humble algorithm: [snip] Comparing it to some of the algorithms in:

Re: [Haskell-cafe] Code and Perf. Data for Prime Finders (was: Genuine Eratosthenes sieve)

2007-02-22 Thread Bulat Ziganshin
Hello Melissa, Thursday, February 22, 2007, 9:54:38 AM, you wrote: - O'Neill (#1) is the algorithm of mine discussed in http:// www.cs.hmc.edu/~oneill/papers/Sieve-JFP.pdf but how it looks compared with classic C implementation of sieve algorithm? -- Best regards, Bulat

Re: [Haskell-cafe] Code and Perf. Data for Prime Finders (was: Genuine Eratosthenes sieve)

2007-02-22 Thread ajb
G'day all. Quoting Melissa O'Neill [EMAIL PROTECTED]: But talk is cheap. What about some actual numbers, and some code for some actual implementations...? Just to fill out the implementations: http://andrew.bromage.org/darcs/numbertheory/ Math/Prime.hs has an implementation of the

Re: [Haskell-cafe] Re: functional database queries

2007-02-22 Thread Bjorn Bringert
On Feb 22, 2007, at 14:56 , Henning Thielemann wrote: On Wed, 21 Feb 2007 [EMAIL PROTECTED] wrote: Albert Y. C. Lai wrote: [EMAIL PROTECTED] wrote: Albert Y. C. Lai wrote: If and only if the database is a purely functional immutable data structure, this can be done. [...] Many

Re: [Haskell-cafe] process

2007-02-22 Thread Albert Y. C. Lai
h. wrote: But it does not work as I expected. As long as there is no need to put some input after having received some output it is no problem, but real interaction seems not possible. Right, this particular program works just for a particular interaction. What real interaction do you have

[Haskell-cafe] HList, hOccurs and MonadReader

2007-02-22 Thread Marc Weber
Having the module given below I can't see why using printAndRerun l1 printAndRerun2 l2 but not printAndRerun l1 printAndRerun l2 ? They only differ in their name. Can you point me in the right direction? {-#

Re: [Haskell-cafe] HList, hOccurs and MonadReader

2007-02-22 Thread Stefan O'Rear
This really smells like a violation of the monomorphism restriction[1]. Try again with -fno-monomorphism-restriction, and if that fixes it, add a type signature to fix it for good. [1] http://haskell.org/onlinereport/decls.html#sect4.5.5 Stefan ___

Re: [Haskell-cafe] Prime finding

2007-02-22 Thread Melissa O'Neill
Ruben Zilibowitz wrote: I see that there has been some discussion on the list about prime finding algorithms recently. I just wanted to contribute my own humble algorithm: Thanks! Comparing it to some of the algorithms in: http://www.haskell.org/pipermail/haskell-cafe/2007-February/

Re: [Haskell-cafe] A real Haskell Cookbook

2007-02-22 Thread Albert Y. C. Lai
Call me a technophile, but it saddens me that ASCII has already held us back for too many decades, and looks like it will still hold us back for another. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org