rendel:
Prabhakar Ragde wrote:
divisors i = [j | j-[1..i-1], i `mod` j == 0]
main = print [i | i-[1..1], i == sum (divisors i)]
Jerzy Karczmarczuk wrote:
My point didn't concern that point. Haskell compiler cannot change an
algorithm using lists into something which deals with
On Sun, Oct 28, 2007 at 01:25:19PM -0700, Don Stewart wrote:
Finally, we can manually translate the C code into a confusing set of nested
loops with interleaved IO,
main = loop 1
where
loop !i | i 1 = return ()
| otherwise = if i == go i 0 1 then
stefanor:
On Sun, Oct 28, 2007 at 01:25:19PM -0700, Don Stewart wrote:
Finally, we can manually translate the C code into a confusing set of nested
loops with interleaved IO,
main = loop 1
where
loop !i | i 1 = return ()
| otherwise = if i ==
On Sun, Oct 28, 2007 at 01:43:07PM -0700, Don Stewart wrote:
stefanor:
IO blocks unboxing in GHC. How fast is your mock-C code refactored to
do IO outside of the loops only?
It doesn't! The above code yields:
Main.$wloop :: GHC.Prim.Int#
- GHC.Prim.State#
On 10/28/07, Stefan O'Rear [EMAIL PROTECTED] wrote:
On Sun, Oct 28, 2007 at 01:43:07PM -0700, Don Stewart wrote:
stefanor:
IO blocks unboxing in GHC. How fast is your mock-C code refactored to
do IO outside of the loops only?
It doesn't! The above code yields:
Main.$wloop ::
dons:
stefanor:
On Sun, Oct 28, 2007 at 01:25:19PM -0700, Don Stewart wrote:
Finally, we can manually translate the C code into a confusing set of
nested
loops with interleaved IO,
main = loop 1
where
loop !i | i 1 = return ()
|