Re: [Haskell-cafe] eager/strict eval katas

2007-12-21 Thread Thomas Hartman
02:24 PM To Thomas Hartman/ext/[EMAIL PROTECTED] cc haskell-cafe@haskell.org Subject Re: [Haskell-cafe] eager/strict eval katas On Dec 12, 2007 2:31 PM, Thomas Hartman [EMAIL PROTECTED] wrote: exercise 2) find the first integer such that average of [1

Re: [Haskell-cafe] eager/strict eval katas

2007-12-12 Thread Felipe Lessa
On Dec 12, 2007 2:31 PM, Thomas Hartman [EMAIL PROTECTED] wrote: exercise 2) find the first integer such that average of [1..n] is [10^6] (solution involves building an accum list of (average,listLength) tuples. again you can't do a naive fold due to stack overflow, but in this case even

Re: [Haskell-cafe] eager/strict eval katas

2007-12-12 Thread Dan Weston
Subject Re: [Haskell-cafe] eager/strict eval katas On Dec 12, 2007 2:31 PM, Thomas Hartman [EMAIL PROTECTED] wrote: exercise 2) find the first integer such that average of [1..n] is [10^6] (solution involves building an accum list of (average,listLength) tuples. again

Re: [Haskell-cafe] eager/strict eval katas

2007-12-12 Thread Benja Fallenstein
Hi Thomas, On Dec 12, 2007 5:31 PM, Thomas Hartman [EMAIL PROTECTED] wrote: (solution involves building an accum list of (average,listLength) tuples. again you can't do a naive fold due to stack overflow, but in this case even strict foldl' from data.list isn't strict enough, I had to define

Re: [Haskell-cafe] eager/strict eval katas

2007-12-12 Thread Don Stewart
benja.fallenstein: Hi Thomas, On Dec 12, 2007 5:31 PM, Thomas Hartman [EMAIL PROTECTED] wrote: (solution involves building an accum list of (average,listLength) tuples. again you can't do a naive fold due to stack overflow, but in this case even strict foldl' from data.list isn't

Re: [Haskell-cafe] eager/strict eval katas

2007-12-12 Thread Benja Fallenstein
On Dec 12, 2007 9:58 PM, Don Stewart [EMAIL PROTECTED] wrote: And no need to even use custom ones, just use the library strict pairs, http://hackage.haskell.org/packages/archive/strict/0.2/doc/html/Data-Strict-Tuple.html Oh, good! :) 'nother Haskell lesson learned. Thanks, - Benja

Re: [Haskell-cafe] eager/strict eval katas

2007-12-12 Thread Dan Weston
@haskell.org Subject Re: [Haskell-cafe] eager/strict eval katas On Dec 12, 2007 2:31 PM, Thomas Hartman [EMAIL PROTECTED] wrote: exercise 2) find the first integer such that average of [1..n] is [10^6] (solution involves building an accum list of (average,listLength) tuples