replace definition of error with errorWithStackTrace

Simon Peyton Jones simonpj at microsoft.com
Mon Dec 29 10:42:05 UTC 2014


| As far as I understand, DWARF information will give us the dynamic
| chain, while the ImplicitLocations idea will give us fragments of the
| static chain. So I believe these two features are complementary, and
| most useful if combined.

I think that's a very accurate summary, thanks.

Simon

| -----Original Message-----
| From: Libraries [mailto:libraries-bounces at haskell.org] On Behalf Of
| Bertram Felgenhauer
| Sent: 25 December 2014 20:10
| To: libraries at haskell.org
| Subject: Re: replace definition of error with errorWithStackTrace
| 
| Johan Tibell wrote:
| > Why don't we use the DWARF information instead? It has no runtime
| overhead
| > so it can actually be turned on always. It also integrates with all the
| > standard open source tooling.
| 
| I think there are two backtrace-like chains of interest for every
| Haskell value: There is one "static" chain that tracks how values are
| created, and one "dynamic" chain that tracks the actual evaluation.
| For example, for
| 
|   makePair :: (Int, Int)
|   makePair = (error "The first component is actually undefined", 42)
| 
|   sumPair :: (Int, Int) -> Int
|   sumPair (a, b) = a + b
| 
|   main = print $ sumPair makePair
| 
| the static chain up to the error call would be
| 
|   main -> makePair -> error
| 
| while the dynamic chain that actually produces the error is something
| like
| 
|   main -> print -> show -> sumPair -> (+) -> error
| 
| As far as I understand, DWARF information will give us the dynamic
| chain, while the ImplicitLocations idea will give us fragments of the
| static chain. So I believe these two features are complementary, and
| most useful if combined.
| 
| Cheers,
| 
| Bertram
| _______________________________________________
| Libraries mailing list
| Libraries at haskell.org
| http://www.haskell.org/mailman/listinfo/libraries


More information about the Libraries mailing list