Popularity
6.5
Growing
Activity
0.0
Stable
17
2
6
Monthly Downloads: 6
Programming language: Haskell
License: MIT License
Latest version: v0.1.1.1
haskell-stack-trace-plugin alternatives and similar packages
Based on the "Compiler Plugin" category.
Alternatively, view haskell-stack-trace-plugin alternatives based on common mentions on social networks and blogs.
-
inspection-testing
Inspection Testing for Haskell -
strict-ghc-plugin
Compiler plugin for making Haskell strict -
const-math-ghc-plugin
GHC plugin for constant math elimination -
smuggler2
Minimise haskell imports, make exports explicit -
unroll-ghc-plugin
Compiler plugin for loop unrolling -
BinderAnn
BinderAnn: Automated Reification of Source Annotations for Monadic EDSLs -
cse-ghc-plugin
Compiler plugin for common subexpression elimination
Collect and Analyze Billions of Data Points in Real Time
Manage all types of time series data in a single, purpose-built database. Run at any scale in any environment in the cloud, on-premises, or at the edge.
Promo
www.influxdata.com
Do you think we are missing an alternative of haskell-stack-trace-plugin or a related project?
README
haskell-stack-trace-plugin
This plugin allow implicitly add HasCallStack
class to every top-level function for all module. Hence, we can to get completely continuous call stack.
- (implicitly) Import GHC.Stack for all modules.
- Add HasCallStack constraint for all top-level functions.
Requirement: (8.6 <= on GHC)
Synopsis
module Main where
import Data.Maybe (fromJust)
main :: IO ()
main = print f1
f1 :: Int
f1 = f2
f2 :: Int
f2 = f3
-- HsQualTy
f3 :: HasCallStack => Int
f3 = f4 0
-- HsQualTy
f4 :: Show a => a -> Int
f4 _ = f5 0 0
-- HsFunTy
f5 :: Int -> Int -> Int
f5 _ _ = head f6
-- HsListTy
f6 :: [Int]
f6 = [fst f7]
-- HsTupleTy
f7 :: (Int, Int)
f7 = (fromJust f8, fromJust f8)
-- HsAppTy
f8 :: Maybe Int
f8 = Just fError
-- HsTyVar
fError :: Int
fError = error "fError"
This example get error:
$ cabal new-build
example/Main.hs:15:7: error:
Not in scope: type constructor or class ‘HasCallStack’
|
15 | f3 :: HasCallStack => Int
| ^^^^^^^^^^^^
Yes, add import GHC.Stack
to above example.
Fix and rebuild!
$ cabal new-run
example: fError
CallStack (from HasCallStack):
error, called at example/Main.hs:41:10 in main:Main
Hmm, it is not useful. But, you will to be happy when enable this plugin.
ghc-options:
-fplugin=StackTrace.Plugin
$ cabal new-run
...
example: fError
CallStack (from HasCallStack):
error, called at example/Main.hs:40:10 in main:Main
fError, called at example/Main.hs:36:11 in main:Main
f8, called at example/Main.hs:32:16 in main:Main
f7, called at example/Main.hs:28:11 in main:Main
f6, called at example/Main.hs:24:15 in main:Main
f5, called at example/Main.hs:20:8 in main:Main
f4, called at example/Main.hs:16:6 in main:Main
f3, called at example/Main.hs:12:6 in main:Main
f2, called at example/Main.hs:9:6 in main:Main
f1, called at example/Main.hs:6:14 in main:Main
main, called at example/Main.hs:6:1 in main:Main
Great!!!