Evening, Ralf.
Ralf Laemmel [EMAIL PROTECTED] 20:27 24/7/2003 wrote:
RL a) Add a class constraint for Show to the Term class.
RL(Would that work? It's a bit invasive anyway.)
Yes, that a bit invasive to say at least. With equal ease I can hack
DrIFT to produce instances of Show the way I
(Let's go to haskell-cafe if we want to continue.)
Hi Dmitry,
Sigh. Indeed, the distributed instance Show TermRep is not fit.
The default TermRep in the Strafunski distribution is not even
willing to disclose constructor names. So there is no way unless
you tweak TermRep (and DrIFT). TermRep
I want to write generic traversal which prints everything on the way:
uglyPrint :: (Term t, Show t) = t - [(String)]
uglyPrint = (map snd) . runIdentity . applyTU (full_tdTU uglyPrintStep)
uglyPrintStep :: (Show t, Term t) = TU [(t, String)] Identity
uglyPrintStep = constTU [] `adhocTU` (return
Very good point!
adhoc and friends support TYPE case.
What's needed here is a so-far unsupported type-CLASS case
which is actually at least non-trivial.
I can only offer semi-solutions:
a) Add a class constraint for Show to the Term class.
(Would that work? It's a bit invasive anyway.)
b)