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

2006-04-07 Thread Christian Maeder
John Meacham wrote: 1. one really does logically derive from the other, Eq and Ord are like this, the rules of Eq says it must be an equivalance relation and that Ord defines a total order over that equivalance relation. this is a good thing, as it lets you write code that depends on these

[Haskell-cafe] Re: [Haskell] reading binary files

2006-04-07 Thread Dmitry V'yal
Hello, Bulat I'm currently working on some kind of program for analysing FAT partitions. Don't ask why did I chose to implement it in Haskell :) Just for fun. My program needs to read scattered chunks of binary data from a huge file and to do a good amount of deserialisation. I implemented

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

2006-04-07 Thread Bulat Ziganshin
Hello Daniel, Friday, April 7, 2006, 2:05:03 AM, you wrote: I've cleaned up my solver, removed a lot of redundant inference steps and made the board a DiffArray (is that really faster?). btw, DiffArray implementation can be made significantly faster by using IORefs instead of MVars -- Best

Re: [Haskell-cafe] Re: [Haskell] reading binary files

2006-04-07 Thread Donald Bruce Stewart
akamaus: Hello, Bulat I'm currently working on some kind of program for analysing FAT partitions. Don't ask why did I chose to implement it in Haskell :) Just for fun. My program needs to read scattered chunks of binary data from a huge file and to do a good amount of deserialisation.

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

2006-04-07 Thread Jacques Carette
Robert Dockins wrote: The behaviour of NaN actually makes perfect sense when you realise that it is Not a Number. Things that are not numbers are incomparable with things that are. Yes, NaN can be of type Float. But it's not a Float. If you take that tack, then you have to concede that

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

2006-04-07 Thread Claus Reinke
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 Kemp's solvers (which are much more beautifully coded), it turned out that mine is blazingly fast, so are there faster

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

2006-04-07 Thread Robert Dockins
On Apr 7, 2006, at 9:43 AM, Jacques Carette wrote: Robert Dockins wrote: The behaviour of NaN actually makes perfect sense when you realise that it is Not a Number. Things that are not numbers are incomparable with things that are. Yes, NaN can be of type Float. But it's not a Float.

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

2006-04-07 Thread Jared Updike
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 you meant instance (Ord T) = Eq T where a == b = case compare

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

2006-04-07 Thread Jacques Carette
Robert Dockins wrote: On Apr 7, 2006, at 9:43 AM, Jacques Carette wrote: [Lots of stuff about IEEE 754] Is this an H' worthy item? It is worth taking a serious look in conjunction with completely redoing the Num class. Minor tweaking of the behaviour on NaNs (which requires a large amount of

[Haskell-cafe] Understanding allocation behavior

2006-04-07 Thread David F. Place
After reading Daniel Fischer's message about trying to use EnumSet in his Sudoku.hs and finding that it was slower when processing a large data set, I decided to do some profiling. I rewrote his solver to use EnumSets and profiled it. The culprit turns out to be the following function

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

2006-04-07 Thread Daniel Fischer
Am Freitag, 7. April 2006 01:50 schrieben Sie: On Apr 6, 2006, at 6:05 PM, Daniel Fischer wrote: I've also written a version using David F. Place's EnumSet instead of [Int], that takes less MUT time, but more GC time, so is slower on the 36,628 test, but faster for a single puzzle.

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

2006-04-07 Thread David Menendez
Robert Dockins writes: On Thursday 06 April 2006 06:44 pm, John Meacham wrote: On Thu, Apr 06, 2006 at 10:52:52PM +0100, Brian Hulley wrote: [snip a question about Eq and Ord classes] well, there are a few reasons you would want to use inheritance in haskell, some good, some bad.

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

2006-04-07 Thread 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 Kemp's solvers (which are much more beautifully coded), it turned out

Re: [Haskell-cafe] Understanding allocation behavior

2006-04-07 Thread Daniel Fischer
Am Freitag, 7. April 2006 22:57 schrieb David F. Place: After reading Daniel Fischer's message about trying to use EnumSet in his Sudoku.hs and finding that it was slower when processing a large data set, I decided to do some profiling. I rewrote his solver to use EnumSets and profiled it.

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

2006-04-07 Thread ihope
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 you meant