Re: [Haskell-cafe] Re: Suspected stupid Haskell Question

2007-10-19 Thread Justin Bailey
On 10/17/07, Thomas Hartman [EMAIL PROTECTED] wrote: Is there a more scientific way of figuring out if one version is better than the other by using, say profiling tools? Profiling Haskell programs is black magic, but of the sort you learn by having a problem to solve. I don't think it

Re: [Haskell-cafe] Re: Suspected stupid Haskell Question

2007-10-18 Thread Bertram Felgenhauer
Thomas Hartman wrote: Since I'm interested in the stack overflow issue, and getting acquainted with quickcheck, I thought I would take this opportunity to compare your ordTable with some code Yitzchak Gale posted earlier, against Ham's original problem. As far as I can tell, they're the

Re: [Haskell-cafe] Re: Suspected stupid Haskell Question

2007-10-18 Thread Yitzchak Gale
Hi Chad, Chad Scherrer wrote: I think the stack overflows were happening because Map.insertWith isn't strict enough. Otherwise I think the code is the same. They are visibly almost identical - except that you do an extra lookup to get your strictness, while insertWith' has internal access and

Re: [Haskell-cafe] Re: Suspected stupid Haskell Question

2007-10-18 Thread Thomas Hartman
PM To Thomas Hartman/ext/[EMAIL PROTECTED] cc haskell-cafe@haskell.org, [EMAIL PROTECTED] Subject Re: [Haskell-cafe] Re: Suspected stupid Haskell Question Hmm, is insertWith' new? If I remember right, I think the stack overflows were happening because Map.insertWith isn't strict enough

Re: [Haskell-cafe] Re: Suspected stupid Haskell Question

2007-10-18 Thread Albert Y. C. Lai
Thomas Hartman wrote: Since I'm interested in the stack overflow issue, and getting acquainted with quickcheck, I thought I would take this opportunity to compare your ordTable with some code Yitzchak Gale posted earlier, against Ham's original problem. As far as I can tell, they're the

[Haskell-cafe] Re: Suspected stupid Haskell Question

2007-10-17 Thread Chad Scherrer
Big_Ham joymachine2001 at hotmail.com writes: Is there a library function to take a list of Strings and return a list of ints showing how many times each String occurs in the list. So for example: [egg, egg, cheese] would return [2,1] I couldn't find anything on a search, or

Re: [Haskell-cafe] Re: Suspected stupid Haskell Question

2007-10-17 Thread Thomas Hartman
Subject [Haskell-cafe] Re: Suspected stupid Haskell Question Big_Ham joymachine2001 at hotmail.com writes: Is there a library function to take a list of Strings and return a list of ints showing how many times each String occurs in the list. So for example: [egg, egg, cheese] would

Re: [Haskell-cafe] Re: Suspected stupid Haskell Question

2007-10-17 Thread Chad Scherrer
Hmm, is insertWith' new? If I remember right, I think the stack overflows were happening because Map.insertWith isn't strict enough. Otherwise I think the code is the same. But I would expect intTable to be faster, since it uses IntMap, and there's no IntMap.insertWith' as of 6.6.1 (though it may