[Haskell-cafe] Literate refactoring?
carette at mcmaster.ca
Thu Nov 19 13:09:05 EST 2009
I'd like to ask the cafe's advice on how to 'do this right'.
The situation is that we've got 2 literate Haskell programs which we
would like to refactor. In fact, this refactoring will ultimately unify
these 2 separate programs into a single framework. Every refactoring
step is well-defined and induces a discrete modification. These
programs also come with tests of their own, which we would like to
refactor along with the code.
In the end, we would like to obtain:
1. For each discrete step, full working programs, with tests and
2. A technical report which describes all the steps from #1 above, as a
literate Haskell document.
For the TechReport, we don't need to be able to extract working code
from it, but the code which is in it should be chunks of the working
programs, not 'independent'. Especially as some of the 'discrete steps'
will result in dead ends, which we want to document, but not otherwise
pursue. In other words, the set of "discrete programs" do not form a
total linear order, but is more like a linear order with a few short
branches hanging off of it.
We were thinking that using some combination of scripts, 'patches',
features from subversion and literate Haskell documents should allow us
to do this. In an ideal world, it would be nice if what we stored was
only (generalized) patches, and we could generate #1 and #2 above from
that. [These patches would be generalized because they would contain
descriptions of what the patch is about, as well as actual patches;
though perhaps that description is really just a patch to the
TechReport, we're not sure].
We were able to envision a number of different partial solutions, but
somehow none of them 'came together' well enough to feel satisfactory.
Instead of biasing the cafe's thinking by laying those pieces out, I
figured I would lay out the high-level requirements, and let creative
solutions come in.
More information about the Haskell-Cafe