Are there any tools to perform program slicing on Haskell? I often find myself wanting to find all "fromJusts" invoked from the current function, or all functions that use a particular member of my monad's ADT.
Assuming that what you want to see are the applications of these functions that occur at run-time, and the evaluation contexts in which they arise, you could try the Hat tracing tools (http://www.cs.york.ac.uk/fp/hat/). Colin R
On Tue, 19 Mar 2002 09:56:49 +0000 "Colin Runciman" <colin@cs.york.ac.uk> wrote:
Are there any tools to perform program slicing on Haskell? I often find myself wanting to find all "fromJusts" invoked from the current function, or all functions that use a particular member of my monad's ADT.
Assuming that what you want to see are the applications of these functions that occur at run-time, and the evaluation contexts in which they arise, you could try the Hat tracing tools (http://www.cs.york.ac.uk/fp/hat/).
Actually I was hoping for a static tool. But now HAT works with GHC I'll be trying it out. Thanks. Sengan
Sengan.Baring-Gould@nsc.com wrote:
Are there any tools to perform program slicing on Haskell? I often find myself wanting to find all "fromJusts" invoked from the current function, or all functions that use a particular member of my monad's ADT.
Actually I was hoping for a static tool.
I'd be interested to learn for what purpose you want this kind of information and also more precisely what you would like such a static tool to do for you. Olaf -- OLAF CHITIL, Dept. of Computer Science, The University of York, York YO10 5DD, UK. URL: http://www.cs.york.ac.uk/~olaf/ Tel: +44 1904 434756; Fax: +44 1904 432767
On Wed, 20 Mar 2002 10:42:15 +0000 "Olaf Chitil" <olaf@cs.york.ac.uk> wrote:
Sengan.Baring-Gould@nsc.com wrote:
Are there any tools to perform program slicing on Haskell? I often find myself wanting to find all "fromJusts" invoked from the current function, or all functions that use a particular member of my monad's ADT.
Actually I was hoping for a static tool.
I'd be interested to learn for what purpose you want this kind of information and also more precisely what you would like such a static tool to do for you.
Olaf
I looked at for what I use the "#" command in vim over the last 2 days, and when it becomes insufficient: * Upwards slicing: - to see what parameters a function is actually given (can be quite a long way from where the parameter is actually constructed, versus simply passed around). - to find dead code (function results that are never used) * Downwards slicing - to debug code (which head failed? One of those under function f, but what are they?) - which instance of (>>=) is it that I'm using here? * Complex queries: A := set of all functions refered to by f1's definition B := set of all functions refered to by f2's definition C := set of functions I'm interested in D := intersection of A, B and C D would then be the functions used both by A and B of the set I'm interested in C. In general the answer is to understand, debug and refactor code in larger projects (my current project weighs 4500 lines of Haskell for instance). Sengan
participants (4)
-
Colin Runciman -
Olaf Chitil -
Sengan.Baring-Gould@nsc.com -
senganb@ia.nsc.com