[Haskell-cafe] RE: simple function: stack overflow in hugs vs nonein ghc

john lask jvlask at hotmail.com
Mon Sep 24 10:12:07 EDT 2007

afraid not

the given example is too strict, the requirement is to generate the matched 
portion lazilly, and return the tail (unconsumed portion).

In principle the function should be capable of being written to run in 
constant space which the given example dose not.

>From: "Claus Reinke" <claus.reinke at talk21.com>
>To: "john lask" 
><jvlask at hotmail.com>,<apfelmus at quantentunnel.de>,<haskell-cafe at haskell.org>
>Subject: Re: [Haskell-cafe] RE: simple function: stack overflow in hugs vs 
>nonein ghc
>Date: Mon, 24 Sep 2007 13:05:24 +0100
>>return (repeat 'a') >>= \ x -> print $ span (const True) x
>>with hugs you will get a stack error, in ghc it executes in constant 
>>space, i.e. indefinitely. In essenece the above example does exactly the 
>>same as my ealier code.
>this thread might be relevant:

Advertisement: Love Footy?  Get AFL, NRL, Rugby live scores and video now!  

More information about the Haskell-Cafe mailing list