On 3/6/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
Does the following code increase the level of recursion
once for each input line or is the recursive construct
converted to an iteration?


As was pointed out, tail recursion in Haskell isn't straightforward.
The answer may also depend on which implementation of Haskell you're
using. But I assume you mean GHC.

If you want to know for sure, I suggest reading the intermediate code
produced by GHC for this example (or perhaps an even smaller version
of your example that retains the recursive structure but doesn't do
IO). For some help with that, check out the manual's section on "How
to read Core Syntax":
http://www.haskell.org/ghc/docs/latest/html/users_guide/options-debugging.html#id3151366

and ask on this mailing list if you have any questions.

Depending on why you're asking, actually reading the intermediate code
may be overkill, but since you didn't say why you wanted to know, I
assume you're just curious.

Cheers,
Kirsten

--
Kirsten Chevalier* [EMAIL PROTECTED] *Often in error, never in doubt
"Instant gratification takes too long."--Carrie Fisher
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to