I have not been following the details, but yes, the strictness analyser
only runs when you say -O, and without strictness analysis you can get
different space behaviour.  Sometimes more, sometimes less.  In this
case, strictness analysis helps.

Simon

| -----Original Message-----
| From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Jules
| Bean
| Sent: 10 December 2004 21:38
| To: GoldPython
| Cc: Henning Thielemann; haskell-cafe
| Subject: Re: [Haskell-cafe] Flattening tail recursion?
| 
| 
| On 10 Dec 2004, at 20:33, GoldPython wrote:
| 
| > Just compiled this with -O and it ran with no stack overflow.
| > Evidently, no `seq` needed for this one. Using ghc 6.2.2.
| >
| > countLines l = countLines' 0 l
| > countLines' n [] = n
| > countLines' n (_:ls) = countLines' (n + 1) ls
| >
| 
| That's presumably the answer. GHC's strictness analyser *can* cope
with
| this situation but only under -O... whereas most of us where testing
| under ghci...
| 
| Confirmation from one of the Simons?
| 
| Jules
| 
| _______________________________________________
| Haskell-Cafe mailing list
| [EMAIL PROTECTED]
| http://www.haskell.org/mailman/listinfo/haskell-cafe
_______________________________________________
Haskell-Cafe mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to