[Haskell-cafe] Re: Call Graph Tool?
qdunkan at gmail.com
Fri Jun 27 03:18:18 EDT 2008
> Assuming I get it included, is there any features in particular you'd want to
> see in there? Note that if I do have it produce visualisations, they'll be
> static images as part of an analysis report rather than being interactive.
I was just recently wondering about something like this.
I'd like the ability to show individual module dependencies, and then
to collapse modules in one package to just the package, so I could
"zoom out" and see how the packages relate to each other. By
"package" here I mean the "A" in "A.B, A.C, etc."
It seems like it would be fairly simple to use Language.Haskell.Parse
to turn a set of modules into a graph, and then something to massage
that and give it to dot.
It actually brings up a question about module discipline in general:
At one point I wanted to have each package re-export its public
modules and then sibling packages can only export the "package" module
as some libraries do, but it got to be too much re-exporting
bookkeeppiing and I didn't so much like symbols having multiple
"homes", and most of all it was increasingly awkward to split packages
into strictly higher level and strictly lower level relationships
since this discipline means coarser granularity which means more
trouble avoiding circular imports. So now I just import modules
directly from their packages. I still have a general structure of
higher, lower, and sibling packages though, so some kind of
visualization would be handy to keep deps under control, look for
packages and modules that could be split up for a clearer hierarchy,
find good places to cut circular imports, etc. I've also thought I
could move private modules in A to A.Private, so you can see that if
you're importing X.Private.Y from a module that doesn't start with X.
then something fishy is going on.
How do other people approach this issue?
More information about the Haskell-Cafe