1# haskell-stack-trace-plugin
3[](https://hackage.haskell.org/package/haskell-stack-trace-plugin)
5This plugin allow implicitly add `HasCallStack` class to every top-level function for all module. Hence, we can to get completely continuous call stack.
71. (implicitly) Import [GHC.Stack](https://www.stackage.org/haddock/lts-12.21/base-4.11.1.0/GHC-Stack.html) for all modules.
82. Add [HasCallStack](https://www.stackage.org/haddock/lts-12.21/base-4.11.1.0/GHC-Stack.html#t:HasCallStack) constraint for all top-level functions.
10Requirement: (8.6 <= on GHC)
17import Data.Maybe (fromJust)
29f3 :: HasCallStack => Int
33f4 :: Show a => a -> Int
37f5 :: Int -> Int -> Int
46f7 = (fromJust f8, fromJust f8)
54fError = error "fError"
57This example get error:
61example/Main.hs:15:7: error:
62 Not in scope: type constructor or class ‘HasCallStack’
6415 | f3 :: HasCallStack => Int
68Yes, add `import GHC.Stack` to above example.
75CallStack (from HasCallStack):
76 error, called at example/Main.hs:41:10 in main:Main
79Hmm, it is not useful. But, you will to be happy when enable this plugin.
83 -fplugin=StackTrace.Plugin
91CallStack (from HasCallStack):
92 error, called at example/Main.hs:40:10 in main:Main
93 fError, called at example/Main.hs:36:11 in main:Main
94 f8, called at example/Main.hs:32:16 in main:Main
95 f7, called at example/Main.hs:28:11 in main:Main
96 f6, called at example/Main.hs:24:15 in main:Main
97 f5, called at example/Main.hs:20:8 in main:Main
98 f4, called at example/Main.hs:16:6 in main:Main
99 f3, called at example/Main.hs:12:6 in main:Main
100 f2, called at example/Main.hs:9:6 in main:Main
101 f1, called at example/Main.hs:6:14 in main:Main
102 main, called at example/Main.hs:6: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