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

2006-04-09 Thread Bulat Ziganshin
Hello David, Saturday, April 8, 2006, 9:58:56 PM, you wrote: > bitsTable :: Array Word Int > bitsTable = array (0,255) $ [(i,bitcount i) | i <- [0..255]] bitsTable :: UArray Word Int bitsTable = listArray (0,255) $ map bitcount [0..255] UArray is much faster than Array but can be used only for

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

2006-04-09 Thread Chris Kuklewicz
I just ran a simple metric for the dancing-links solver. The only real metric I could use was the number of "coverOthers" calls which counts the number of selections made (there is no distinction between certainty and guessing). So the minimum # of selections is 81 (of which 17 are the free hints

[Haskell-cafe] Chapter 4 of Hitchhikers Guide to the Haskell is out

2006-04-09 Thread Dmitry Astapov
Hello, After great amount of procrastination I finally put online the next installment of my Haskell tutorial, which could be found at http://www.haskell.org/haskellwiki/Hitchhikers_Guide_to_the_Haskell Many thanks to all who commented on my efforst, spell-checked the text and urged me to go fo

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

2006-04-09 Thread Bulat Ziganshin
Hello Robert, Sunday, April 9, 2006, 2:54:58 AM, you wrote: > findMinIndex :: Word -> Int > findMaxIndex :: Word -> Int on the other side, these procedures can use the same divide-to-bytes technique as `size` findMinIndex 0 = undefined findMinIndex n = case (n `shiftR` 8) of

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

2006-04-09 Thread David F. Place
Hi Bulat, On Apr 9, 2006, at 6:31 AM, Bulat Ziganshin wrote: on the other side, these procedures can use the same divide-to-bytes technique as `size` findMinIndex 0 = undefined findMinIndex n = case (n `shiftR` 8) of 0 -> minIndexInByte ! (n .&. 255) b ->

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

2006-04-09 Thread Daniel Fischer
Am Samstag, 8. April 2006 10:21 schrieb Chris Kuklewicz: > Daniel Fischer wrote: > > But, lo and behold, I also tried how plain 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%

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

2006-04-09 Thread Bulat Ziganshin
Hello David, Sunday, April 9, 2006, 5:47:03 PM, you wrote: > In an email to me, Jean-Philippe Bernardy expressed a concern that a > large table could needlessly fill the data cache. He proposed > checking 4 bits at a time and using a small table of 16 elements. > Not surprisingly, it isn't

Re: [Haskell-cafe] Re: Justification for Ord inheriting from Eq?

2006-04-09 Thread Stephen Forrest
On 4/7/06, Jared Updike <[EMAIL PROTECTED]> wrote: > > given an Ord instance (for a type T) a corresponding Eq instance can be > > given by: > > > > instance Eq T where > > a == b = compare a b == EQ > > where did this second -^ == come from? (I guess if if Ordering > derives Eq :-) I think

[Haskell-cafe] Re: lambda evaluator in GADT

2006-04-09 Thread Stefan Monnier
> The introduction to GADT usually starts with a little expression > evaluator. So I gave it a try, but there are some troubles. Actually, the generalization is not necessarily trivial at all, depending on what you need to do with your ASTs. >> data E a where >> Lit :: a -> E a >> App :: E (a ->