Re: [Haskell-cafe] Code Review: Sudoku solver

2006-04-08 Thread Chris Kuklewicz
Daniel Fischer wrote: > But, lo and behold, I also tried how plai Array fared in comparison to > DiffArray and ... reduced the running time to under ten minutes (a little > above for the list version), 5% GC time without -AxM, 1.2% with -A8M. > > And I thought, DiffArrays were supposed to be f

Re[2]: [Haskell-cafe] Code Review: Sudoku solver

2006-04-08 Thread Bulat Ziganshin
Hello Daniel, Saturday, April 8, 2006, 3:06:03 AM, you wrote: > And I thought, DiffArrays were supposed to be fast! 1. your arrays are too small (8 elements only) 2. DiffArray use internally MVars. with IORefs they will be a lot faster -- Best regards, Bulatmailto

Re[2]: [Haskell-cafe] Understanding allocation behavior

2006-04-08 Thread Bulat Ziganshin
Hello Daniel, Saturday, April 8, 2006, 4:21:14 AM, you wrote: > Unless I overlooked something, I use foldBits only via size (though that's > used a lot). size of set? there is much faster method - use a table [0..255] -> number of bits in this number seen as set then we split Word to the bytes

Re[2]: [Haskell-cafe] Code Review: Sudoku solver

2006-04-08 Thread Bulat Ziganshin
Hello Chris, Saturday, April 8, 2006, 12:21:07 PM, you wrote: > backtracking. And I can use STRef's to build it, instead of MVars. may be it's better to use unboxed arrays/references? -- Best regards, Bulatmailto:[EMAIL PROTECTED] __

[Haskell-cafe] Re: Positive integers

2006-04-08 Thread Aaron Denney
On 2006-04-02, ihope <[EMAIL PROTECTED]> wrote: > On 3/29/06, Aaron Denney <[EMAIL PROTECTED]> wrote: >> (And yes, we desperately need something like class aliases.) > > You mean like this? Not quite, I meant something like John Meacham's proposal: http://repetae.net/john/recent/out/classalias.htm

Re: Re[2]: [Haskell-cafe] Understanding allocation behavior

2006-04-08 Thread Robert Dockins
On Apr 8, 2006, at 4:24 AM, Bulat Ziganshin wrote: Hello Daniel, Saturday, April 8, 2006, 4:21:14 AM, you wrote: Unless I overlooked something, I use foldBits only via size (though that's used a lot). size of set? there is much faster method - use a table [0..255] -> number of bits in t

Re: Re[2]: [Haskell-cafe] Understanding allocation behavior

2006-04-08 Thread David F. Place
Thanks Bulat and Robert. I implemented Bulat's idea as the following. It tests faster than Roberts. I use Robert's to compute the table. The performance seems satisfactory now. size :: Set a -> Int size (Set w) = countBits w where countBits w | w == 0 = 0 | o

Re: Re[2]: [Haskell-cafe] Understanding allocation behavior

2006-04-08 Thread David F. Place
On Apr 8, 2006, at 4:24 AM, Bulat Ziganshin wrote: foldBits can be made faster (may be) by adding strict annotations: foldBits :: Bits c => (a -> Int -> a) -> a -> c -> a foldbits _ z bs | z `seq` bs `seq` False = undefined foldBits' :: Bits c => (a -> Int -> a) -> Int -> c -> a -> a foldbit

[Haskell-cafe] Re: Proposal for restructuring Number classes

2006-04-08 Thread Serge D. Mechveliani
On Sat, Apr 08, 2006 at 02:39:39PM +0200, Andrew U. Frank wrote: > there has been discussions on and off indicating problems with the structure > of the number classes in the prelude. i have found a discussion paper by > mechveliani but i have not found a concrete proposal on the haskell' list of

[Haskell-cafe] Re: Proposal for restructuring Number classes

2006-04-08 Thread Aaron Denney
On 2006-04-08, Serge D. Mechveliani <[EMAIL PROTECTED]> wrote: > I think that without dependent types for a Haskell-like language, > it is impossible to propose any adequate and in the same time plainly > looking algebraic class system. Depends on what you count as adequate. Mostly I don't n

[Haskell-cafe] web servers

2006-04-08 Thread Tim Newsham
Hi Everyone, I'm new to the list, been on irc a bit. I'm still learning haskell. Wanted to say Hi before getting in to things... I'm interested in real-world programs in haskell, especially ones where security and formal methods are important. I'm looking at web servers right now. I found

Re: [Haskell-cafe] Code Review: Sudoku solver

2006-04-08 Thread Chris Kuklewicz
I have finished my cleanup of the dancing links based solver for Sudoku. I don't have time to compare performance with the other programs that have been posted recently, or to do more profiling of my code. For those who will say "It is ugly, imperative, and ugly!" please remember this is a conver

[Haskell-cafe] Rank 2 polymorphism in pattern matching?

2006-04-08 Thread C Rodrigues
This counterintuitive typechecking result came up when I wrote a wrapper around runST. Is there some limitation of HM with respect to type checking pattern matching? data X a b = X (a -> a) run :: forall a. (forall b. X a b) -> a -> a -- This definition doesn't pass the typechecker run (X f) =

[Haskell-cafe] Re: Rank 2 polymorphism in pattern matching?

2006-04-08 Thread Aaron Denney
On 2006-04-08, C Rodrigues <[EMAIL PROTECTED]> wrote: > This counterintuitive typechecking result came up when I wrote a wrapper > around runST. Is there some limitation of HM with respect to type checking > pattern matching? > > data X a b = X (a -> a) > run :: forall a. (forall b. X a b) -> a

Re: [Haskell-cafe] Rank 2 polymorphism in pattern matching?

2006-04-08 Thread Bruno Oliveira
Hello, See this message: http://article.gmane.org/gmane.comp.lang.haskell.general/13145/ Your (initial) program should work in GHC 6.2. I actually find this feature useful, but Simon apparently changed this when moving to GHC 6.4 and nobody complained... Apparently not many people us

[Haskell-cafe] lambda evaluator in GADT

2006-04-08 Thread paul
The introduction to GADT usually starts with a little expression evaluator. So I gave it a try, but there are some troubles. A little data type for lambda expression > data E a where > Lit :: a -> E a > App :: E (a -> b) -> E a -> E b > Lam :: Var a -> E b -> E (a -> b) > Val :: Var a ->

Re: Re[2]: [Haskell-cafe] Understanding allocation behavior

2006-04-08 Thread Robert Dockins
On Apr 8, 2006, at 1:58 PM, David F. Place wrote: Thanks Bulat and Robert. I implemented Bulat's idea as the following. It tests faster than Roberts. I use Robert's to compute the table. The performance seems satisfactory now. size :: Set a -> Int size (Set w) = countBits w where

Re: [Haskell-cafe] Code Review: Sudoku solver

2006-04-08 Thread Daniel Fischer
Am Samstag, 8. April 2006 02:20 schrieb Daniel Fischer: > Am Freitag, 7. April 2006 17:33 schrieben Sie: > > > Just out of curiosity, speed was not the objective when I wrote my > > > solver, I wanted to avoid guesswork (as much as possible), but in > > > comparison with Cale Gibbard's and Alson Ke

Re: [Haskell-cafe] Understanding allocation behavior

2006-04-08 Thread Daniel Fischer
Hum, oddly, these actually slow things down. While the new size brought the sudoku17 time from ~570s down to ~490s, the new findMinIndex/findMaxIndex increased the time to ~515s, although hardly used. Why? Cheers, Daniel Am Sonntag, 9. April 2006 00:54 schrieb Robert Dockins: > On Apr 8, 2006,

Re: [Haskell-cafe] Code Review: Sudoku solver

2006-04-08 Thread Daniel Fischer
Am Samstag, 8. April 2006 20:28 schrieb Chris Kuklewicz: > I have finished my cleanup of the dancing links based solver for Sudoku. > > I don't have time to compare performance with the other programs that have > been posted recently, or to do more profiling of my code. Your dancing links: ckSud

Re: [Haskell-cafe] web servers

2006-04-08 Thread Jared Updike
I don't know if there's anything newer, but you could check out: http://happs.org/HAppS/README.html http://www.informatik.uni-freiburg.de/~thiemann/WASH/ Hope that helps, Jared. On 4/8/06, Tim Newsham <[EMAIL PROTECTED]> wrote: > Hi Everyone, > I'm new to the list, been on irc a bit. I'm