Guy,  You write,

   But now suppose that some of the annotations refer to FooTree items
   (another thing I forgot to say).  I suppose I could do
   
        data FooTree a b  =  Leaf b | Node a (FooTree a b)
                                        a (FooTree a b)
                                        [FooTree a b]
   
   including a list of goodies that the annotations could then refer to,
   but I'm quickly losing my abstractions--the annotations are spread
   out rather than being single items.

I don't understand.  Can't you handle this is as follows?

     data FooTree a b  =  Leaf b | Node a (FooTree a b) a (FooTree a b)
     data Annote a b c =  MkAnnote Info (FooTree (Annote a b c) b) c

and then infer that what you are acting on is a

    FooTree (Annote a b c) b.

The c field can be omitted, or it can be instantiated to additional
annotation information later on.

I'm sure you can hack around the problem, but it's not yet clear
to me that there isn't an elegant solution.  Cheers,  -- P



Reply via email to