
Hi, I am in the midst of debugging and got an exception: *** Exception: Prelude.minimum: empty list That's all it said. There was no information about where the exception occurred. Is it possible to ask for more information, preferably including a stack trace? Thanks. * -- Russ *

Great question!
To the best of my knowledge, there is no decent solution. I'd be very
interested in hearing about alternatives and their statuses though.
On 5 December 2010 00:49, Russ Abbott
Hi,
I am in the midst of debugging and got an exception:
*** Exception: Prelude.minimum: empty list
That's all it said. There was no information about where the exception occurred. Is it possible to ask for more information, preferably including a stack trace?
Thanks. * -- Russ *
-- Ozgur Akgun

You might want to try out monadloc[1] and control-monad-exception[2],
which provide some monadic stack traces via a preprocessor.
Michael
[1] http://hackage.haskell.org/package/monadloc
[2] http://hackage.haskell.org/package/control-monad-exception
On Sun, Dec 5, 2010 at 2:49 AM, Russ Abbott
Hi, I am in the midst of debugging and got an exception:
*** Exception: Prelude.minimum: empty list
That's all it said. There was no information about where the exception occurred. Is it possible to ask for more information, preferably including a stack trace? Thanks.
-- Russ
_______________________________________________ Beginners mailing list Beginners@haskell.org http://www.haskell.org/mailman/listinfo/beginners

Wrong way to solve the problem in my opinion. Making source code modifications so that you can know which call to minimum got an empty list seems backwards. At the very least we should be able to get a file & line number. Can't we? (Just to be clear, I don't have a solution, but I've hit the same problem) On 5 Dec 2010, at 14:36, Michael Snoyman wrote:
You might want to try out monadloc[1] and control-monad-exception[2], which provide some monadic stack traces via a preprocessor.
Michael
[1] http://hackage.haskell.org/package/monadloc [2] http://hackage.haskell.org/package/control-monad-exception
On Sun, Dec 5, 2010 at 2:49 AM, Russ Abbott
wrote: Hi, I am in the midst of debugging and got an exception:
*** Exception: Prelude.minimum: empty list
That's all it said. There was no information about where the exception occurred. Is it possible to ask for more information, preferably including a stack trace? Thanks.
-- Russ
_______________________________________________ Beginners mailing list Beginners@haskell.org http://www.haskell.org/mailman/listinfo/beginners
_______________________________________________ Beginners mailing list Beginners@haskell.org http://www.haskell.org/mailman/listinfo/beginners

-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 12/5/10 10:12 , Paul Sargent wrote:
Wrong way to solve the problem in my opinion. Making source code modifications so that you can know which call to minimum got an empty list seems backwards.
At the very least we should be able to get a file & line number. Can't we?
Problem is that lazy evaluation makes the whole notion fuzzy; the error is likely to be triggered in a thunk at a location related to the error only by the fact that it forced the thunk to be evaluated. - -- brandon s. allbery [linux,solaris,freebsd,perl] allbery@kf8nh.com system administrator [openafs,heimdal,too many hats] allbery@ece.cmu.edu electrical and computer engineering, carnegie mellon university KF8NH -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.10 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkz7xbsACgkQIn7hlCsL25WbkACfRVYSyaif/VU9GOnVfCr+SOHX 9p0AoK7t/Hks7d0LaWJuwRHIXYeV/5Hs =iO36 -----END PGP SIGNATURE-----

On 5 Dec 2010, at 17:02, Brandon S Allbery KF8NH wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On 12/5/10 10:12 , Paul Sargent wrote:
Wrong way to solve the problem in my opinion. Making source code modifications so that you can know which call to minimum got an empty list seems backwards.
At the very least we should be able to get a file & line number. Can't we?
Problem is that lazy evaluation makes the whole notion fuzzy; the error is likely to be triggered in a thunk at a location related to the error only by the fact that it forced the thunk to be evaluated.
Ok, but tag each thunk with the code location that generated it, and then when thunk triggers thunk triggers thunk isn't that your stack trace. Obviously you'd only do this when debugging code, but that's like adding debug symbols to C compilation. I'm being simplistic I know, but what am I missing? Are we talking about too much info attached to too many thunks? (Personally I've taken to using the Safe module http://hackage.haskell.org/packages/archive/safe/0.3/doc/html/Safe.html to get around this fact that some Prelude functions can fail. That way I can either write functions that can't fail, or I can define my own messages so that the error message is useful. Alternatively, I sometimes use Debug.Trace, but that isn't always that easy to insert, and you have to be careful what you decide to print out as it can cause things to be evaluated.)
participants (5)
-
Brandon S Allbery KF8NH
-
Michael Snoyman
-
Ozgur Akgun
-
Paul Sargent
-
Russ Abbott