什么是调试haskell代码的好方法? [英] What is a good way to debug haskell code?

查看:278
本文介绍了什么是调试haskell代码的好方法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用过ghci调试器,但是如果它与文本编辑器有一些集成,那么真的更喜欢简化设置断点的过程。它可能不会严格评估每个可见变量,但至少简化了查看本地状态的过程。

I have used the ghci debugger but would really prefer if it was somewhat integrated with a text editor to simplify the process of setting breakpoints. It should probably not strictly evaluate every visible variable but at least simplify the process of looking at the local state.

我最近发现了通过允许调试有用的跟踪功能

I recently found the trace function which has been helpful by allowing debug printouts from otherwise hard places.

推荐答案

调试Haskell代码的一个好方法是使用 QuickCheck SmallCheck 。已经有几个Haskell调试器,包括Hat,Hood和Freya,但是没有一个被认为是有价值的,值得维持很长时间。

A good way to debug Haskell code is to write and test algebraic laws using QuickCheck and SmallCheck. There have been several Haskell debuggers including Hat, Hood, and Freya, but none of them have been perceived as sufficiently valuable to be worth maintaining for a long time.

当它是哈斯克尔,你必须对如何做事情有所不同。 QuickCheck页面上的ICFP论文有一些很好的例子,让您开始。如果你想要一个真实的例子, xmonad 被广泛调试使用QuickCheck。

When it's Haskell, you have to think differently about how to do things. The ICFP paper on the QuickCheck page has some good examples to get you started. If you want a real-world example xmonad is extensively debugged using QuickCheck.

这篇关于什么是调试haskell代码的好方法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆