[Haskell-beginners] exceptions and stacks

Emmanuel Touzery etouzery at gmail.com
Thu Nov 8 21:49:46 CET 2012


Well I recompiled but now I don't anymore have the input data to reproduce
the problem. However if I hit control-c during the runtime, i get a very
nice, and very big, stack, so i think it would work. So, great! Just be
sure to use ghc 7.4+.

emmanuel

On Thu, Nov 8, 2012 at 6:32 PM, Emmanuel Touzery <etouzery at gmail.com> wrote:

> Well I tried and it displays the same with GHC 7.4.1.
>
> However this is the output with GHC 7.0.4:
> <GHC.List.CAF>stack: Prelude.head: empty list
>
> So this is supported from 7.4 onwards (well maybe 7.2, I guess that
> version existed).
>
> So there are all the chances that with GHC 7.4.1 I would get a proper
> stack for my problem. I'll try it soon but I must reinstall all the
> libraries with profiling on the computer on which I have 7.4.1...
>
> emmanuel
>
> On Thu, Nov 8, 2012 at 1:08 PM, Ozgur Akgun <ozgurakgun at gmail.com> wrote:
>
>> fwiw, I am getting a stack trace with 7.6.1.
>>
>> -- stack.hs
>> main = print $ foo [1]
>> foo xs = bar xs ++ bar xs
>> bar (x:xs) = [x, head xs]
>>
>> $ ghc -prof -auto-all -rtsopts stack.hs
>>
>> $ ./stack +RTS -xc
>> *** Exception (reporting due to +RTS -xc): (THUNK_2_0), stack trace:
>>   GHC.List.CAF
>>   --> evaluated by: Main.bar,
>>   called from Main.foo,
>>   called from Main.main,
>>   called from Main.CAF
>>   --> evaluated by: Main.main,
>>   called from Main.CAF
>> stack: Prelude.head: empty list
>>
>>
>>
>> --
>> Ozgur Akgun
>>
>> _______________________________________________
>> Beginners mailing list
>> Beginners at haskell.org
>> http://www.haskell.org/mailman/listinfo/beginners
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/beginners/attachments/20121108/e1f2c64a/attachment-0001.htm>


More information about the Beginners mailing list