Simon Marlow writes (to the Haskell mailing list)

>The function as written is only strict in its list argument, and
>its usage site only demands the 'l' argument strictly.  So [..]
>the compiler can't possibly evaluate the accumulating parameters
>of countAll' strictly.

The Clean compiler uses an optimisation that works in this case.
After observing that main evaluates all elements of the tuple
result (because of the shows), the compiler creates a special
version of countAll with (Clean) type
    countAll :: String -> (!Int, !Int, !Int)
and the same for countAll`. It than calls the strictness analyzer
again for these functions.



Cheers,

Ronny Wichers Schreur

_______________________________________________
Haskell mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell

Reply via email to