[Haskell-beginners] exceptions and stacks

Ozgur Akgun ozgurakgun at gmail.com
Thu Nov 8 13:08:30 CET 2012


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/beginners/attachments/20121108/ffefa624/attachment.htm>


More information about the Beginners mailing list