debugging - How to print with line number and stack trace in Haskell? -


i java appended print statements , had stack trace...

how can print line numbers log in java

public static int getlinenumber() {     // second row of stack trace had caller file name, etc.     return thread.currentthread().getstacktrace()[2]; } 

how do haskell?

i think found solution:

debug.trace: functions tracing , monitoring execution.

tracestack :: string -> -> source

like trace, additionally prints call stack if 1 available.

in current ghc implementation, call stack availble if program compiled -prof; otherwise tracestack behaves trace. entries in call stack correspond scc annotations, idea use -fprof-auto or -fprof-auto-calls add scc annotations automatically.

since: 4.5.0.0

^ https://hackage.haskell.org/package/base-4.8.2.0/docs/debug-trace.html


Comments

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -