1# haskell-stack-trace-plugin
3
4[](https://hackage.haskell.org/package/haskell-stack-trace-plugin)
6This plugin allow implicitly add `HasCallStack` class to every top-level function for all module. Hence, we can to get completely continuous call stack.
81. (implicitly) Import [GHC.Stack](https://hackage.haskell.org/package/base/docs/GHC-Stack.html) for all modules.
92. Add [HasCallStack](https://hackage.haskell.org/package/base/docs/GHC-Stack.html#t:HasCallStack) constraint for all top-level functions.
103. Other supported syntaxes
13Requirement: (8.6 <= on GHC)
20import Data.Maybe (fromJust)
32f3 :: HasCallStack => Int
36f4 :: Show a => a -> Int
40f5 :: String -> Int -> Int
49f7 = (fromJust f8, fromJust f8)
63fError = error "fError"
66This example get error:
70example/Main.hs:15:7: error:
71 Not in scope: type constructor or class ‘HasCallStack’
7315 | f3 :: HasCallStack => Int
77Yes, add `import GHC.Stack` to above example.
82$ cabal run example -v0
84CallStack (from HasCallStack):
85 error, called at example/Main.hs:47:10 in main:Main
88Hmm, it is not useful. But, you will to be happy when enable this plugin.
92 -fplugin=StackTrace.Plugin
96$ cabal run example -v0
98CallStack (from HasCallStack):
99 error, called at example/Main.hs:47:10 in main:Main
100 fError, called at example/Main.hs:43:11 in main:Main
101 f10, called at example/Main.hs:40:6 in main:Main
102 f9, called at example/Main.hs:37:11 in main:Main
103 f8, called at example/Main.hs:33:16 in main:Main
104 f7, called at example/Main.hs:29:11 in main:Main
105 f6, called at example/Main.hs:25:15 in main:Main
106 f5, called at example/Main.hs:21:8 in main:Main
107 f4, called at example/Main.hs:17:6 in main:Main
108 f3, called at example/Main.hs:13:6 in main:Main
109 f2, called at example/Main.hs:10:6 in main:Main
110 f1, called at example/Main.hs:7:14 in main:Main
111 main, called at example/Main.hs:7:1 in main:Main
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list