[Haskell-cafe] Graph theory analysis of Haskell code

Tommy McGuire mcguire at crsr.net
Thu Dec 6 12:10:03 EST 2007

Ivan Miljenovic wrote:
> How I envisage it happening is that a parser would be used to find all
> "functions" in the given code, treat these as nodes in the graph and
> then use directed edges to indicate which functions call other
> functions.  This resultant graph can then be analysed in various ways
> suitable to the context (e.g. find that a library module can be split
> into two since there are two completely separate trees present in the
> graph that don't interact at all, or if a function is only ever called
> by one other function then it can be subsumed into it).

It just occurred to me that this idea is more general than the control 
or data flow analysis that are the focus of similar ideas I've seen 
before.  For example, you could trace type usage through the code (which 
would likely be a subset of the control flow for Haskell, but an 
interesting subset nonetheless).  :-)

Tommy M. McGuire
mcguire at crsr.net

More information about the Haskell-Cafe mailing list