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
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
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
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
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
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
@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