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-4.12.0.0/docs/GHC-Stack.html) for all modules.
92. Add [HasCallStack](https://hackage.haskell.org/package/base-4.12.0.0/docs/GHC-Stack.html#t:HasCallStack) constraint for all top-level functions.
11Requirement: (8.6 <= on GHC)
18import Data.Maybe (fromJust)
30f3 :: HasCallStack => Int
34f4 :: Show a => a -> Int
38f5 :: Int -> Int -> Int
47f7 = (fromJust f8, fromJust f8)
55fError = error "fError"
58This example get error:
62example/Main.hs:15:7: error:
63 Not in scope: type constructor or class ‘HasCallStack’
6515 | f3 :: HasCallStack => Int
69Yes, add `import GHC.Stack` to above example.
76CallStack (from HasCallStack):
77 error, called at example/Main.hs:41:10 in main:Main
80Hmm, it is not useful. But, you will to be happy when enable this plugin.
84 -fplugin=StackTrace.Plugin
92CallStack (from HasCallStack):
93 error, called at example/Main.hs:40:10 in main:Main
94 fError, called at example/Main.hs:36:11 in main:Main
95 f8, called at example/Main.hs:32:16 in main:Main
96 f7, called at example/Main.hs:28:11 in main:Main
97 f6, called at example/Main.hs:24:15 in main:Main
98 f5, called at example/Main.hs:20:8 in main:Main
99 f4, called at example/Main.hs:16:6 in main:Main
100 f3, called at example/Main.hs:12:6 in main:Main
101 f2, called at example/Main.hs:9:6 in main:Main
102 f1, called at example/Main.hs:6:14 in main:Main
103 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