Michael Snoyman mich...@snoyman.com writes:
I had a bug in a site of mine[1] for a few weeks, where it would just print:
Prelude.head: empty list
It took a long time to track down the problem
+1: I've been arguing this for something like ten years :-)
One half-baked quasi-solution is
On Mon, 30 Apr 2012 10:31:01 +0200, Ketil Malde ke...@malde.org wrote:
One half-baked quasi-solution is to use:
#define head (\xs - case xs of { (x:_) - x ; _ - error(head: empty
list at++__FILE__++show __LINE__)})
Downsides are that it depends on CPP, and, CPP being a C preprocessor,
it
On Thu, Apr 26, 2012 at 5:05 PM, Joachim Breitner
m...@joachim-breitner.de wrote:
Hi,
Am Mittwoch, den 25.04.2012, 18:36 +0300 schrieb Michael Snoyman:
I'm sure there are many better ways to approach the problem, and I
can't speak to the complexity of implementation within GHC. I *can*
say,
On Thu, Apr 26, 2012 at 12:20 AM, Simon Peyton-Jones
simo...@microsoft.com wrote:
Tristan Allwood got quite a long way with this a couple of years ago.
http://research.microsoft.com/en-us/um/people/simonpj/papers/stack-trace/DebugTraces.pdf
While stack traces are undoubtably useful, I think
] Printing call site for partial functions
|
| And then have the compiler automatically include (optional) package
| name, module name, and line number where `headContext` was called. How
| about we borrow a bit from rewrite rules, and have a pragma such as:
|
| {-# WITH_CONTEXT head headContext
On 25/04/2012 17:28, Ozgur Akgun wrote:
Hi,
On 25 April 2012 16:36, Michael Snoyman mich...@snoyman.com
mailto:mich...@snoyman.com wrote:
Prelude.head: empty list
Recent versions of GHC actually generate a very helpful stack trace, if
the program is compiled with profiling
On Wed, Apr 25, 2012 at 7:28 PM, Ozgur Akgun ozgurak...@gmail.com wrote:
Hi,
On 25 April 2012 16:36, Michael Snoyman mich...@snoyman.com wrote:
Prelude.head: empty list
Recent versions of GHC actually generate a very helpful stack trace, if the
program is compiled with profiling turned
Hi,
Am Mittwoch, den 25.04.2012, 18:36 +0300 schrieb Michael Snoyman:
I'm sure there are many better ways to approach the problem, and I
can't speak to the complexity of implementation within GHC. I *can*
say, however, that this would have saved me a lot of time in the
example I gave above,
I had a bug in a site of mine[1] for a few weeks, where it would just print:
Prelude.head: empty list
It took a long time to track down the problem, as it came from some
other library I was depending on. Eventually I tracked it down,
reported it, and the problem was fixed the next day. The
And then have the compiler automatically include (optional) package
name, module name, and line number where `headContext` was called. How
about we borrow a bit from rewrite rules, and have a pragma such as:
{-# WITH_CONTEXT head headContext #-}
This seems similar to the SRCLOC_ANNOTATE
Hi,
On 25 April 2012 16:36, Michael Snoyman mich...@snoyman.com wrote:
Prelude.head: empty list
Recent versions of GHC actually generate a very helpful stack trace, if the
program is compiled with profiling turned on and run with -xc.
See:
11 matches
Mail list logo