Tools for generating Haskell function dependency (control flow) graph?

五迷三道 提交于 2019-11-28 17:04:18

问题


Note not "functional dependency". Are there tools available that allow me to build a static function dependency graph from source code? Something which indicates to me which functions depend on which other ones in a graphical manner.


回答1:


Yes, there certainly are. If you look in the Development category on Hackage, you'll find tools for:

  • graphing package dependencies -- n.b requres older cabal
  • graphing module dependencies
  • graphing function calls
  • graphing running data structures

In particular, SourceGraph contains many analysis passes, including:

  • visualizing function calls
  • computing cyclomatic complexity
  • visualizing module imports

Other tools that you might be interested in are:

  • HPC, for visualizing test coverage
  • ThreadScope, for visualizing runtime behavior
  • lscabal, extract modules from a package

Here is the functional call graph produced by SourceGraph run over cabal2arch:



来源:https://stackoverflow.com/questions/3431225/tools-for-generating-haskell-function-dependency-control-flow-graph

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!