如何在Haskell中获得一个callstack? [英] How do I get a callstack in Haskell?
问题描述
是否可以在haskell中获取一个callstack,以便我知道哪个参数导致错误?我也会认为这应该被编译器所捕获,因为它应该能够查看我的类型和模式,并确保有一个相应的匹配。
您可以使用确定异常来自哪里。
我走过一个完整的例子这里。
I am trying to track down a non-exhaustive pattern in a libraries code. Specifically HDBC's mysql implementation. It is trying to match over types in my program and map them to mysql's types I believe. I can't seem to get a callstack for this error which means that since there are a number of parameters to the SQL query it is difficult to track down exactly what is causing it.
Is it possible to get a callstack in haskell so I would know which parameter was causing the error? Also I would think that this should be caught by the compiler since it should be able to look at my types and the patterns and make sure that there was a corresponding match.
You can use the GHCi debugger to identify where the exception is coming from.
I walk through a full example here.
这篇关于如何在Haskell中获得一个callstack?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!