Re: [Haskell-cafe] Debugging partial functions by the rules

2006-11-18 Thread Donald Bruce Stewart
ndmitchell: Hi To see at a glance the various bug reports about fromJust you can search the bug database: http://bugs.darcs.net/[EMAIL PROTECTED]@sort=activity@group=priority@search_text=fromJust I count 7 bugs. I would be interested to see the results of static analysis tools

Re: [Haskell-cafe] Debugging partial functions by the rules

2006-11-15 Thread Neil Mitchell
Hi I have always been wondering why error shouldn't always return a call stack from the occurrance of fromJust up to the function I typed into ghci (or up to main, for that matter). yhi-stack (as yet unreleased) does exactly this, without requiring you to recompile your code even. hat-stack

RE: [Haskell-cafe] Debugging partial functions by the rules

2006-11-15 Thread Simon Peyton-Jones
| I have always been wondering why error shouldn't always return a call | stack from the occurrance of fromJust up to the function I typed into | ghci (or up to main, for that matter). | | I guess this is because the call tree is rewritten extensively before | being evaluated, and the output

Re: [Haskell-cafe] Debugging partial functions by the rules

2006-11-15 Thread Claus Reinke
Couldn't we just use rewrite rules to rewrite *transparently* all uses of fromJust to safeFromJust, tagging the call site with a location? .. Looks good! But that is deceiving: the assert was expanded before the rule fired, and refers to the rewrite rule source line (line 19), not the

Re: [Haskell-cafe] Debugging partial functions by the rules

2006-11-14 Thread Matthias Fischmann
On Wed, Nov 15, 2006 at 03:54:31PM +1100, Donald Bruce Stewart wrote: To: glasgow-haskell-users@haskell.org Cc: haskell-cafe@haskell.org From: Donald Bruce Stewart [EMAIL PROTECTED] Date: Wed, 15 Nov 2006 15:54:31 +1100 Subject: [Haskell-cafe] Debugging partial functions by the rules So

[Haskell-cafe] Debugging partial functions by the rules

2006-11-14 Thread Donald Bruce Stewart
So all this talk of locating head [] and fromJust failures got me thinking: Couldn't we just use rewrite rules to rewrite *transparently* all uses of fromJust to safeFromJust, tagging the call site with a location? To work this requires a few things to go right: * a rewrite rule

Re: [Haskell-cafe] Debugging partial functions by the rules

2006-11-14 Thread Jason Dagit
On 11/14/06, Donald Bruce Stewart [EMAIL PROTECTED] wrote: So, further work: * have 'assert' respected when -O is on * think up a technique for splicing in 'assert' via rewrite rules (or TH ...) such that the src locations are expanded after the rewrite, and correctly reflect the