Date: Tue, 23 Feb 93 10:16:58 GMT
From: wadler <[EMAIL PROTECTED]>
Given your correction, I think that the type declaration
data FooTree a b = Leaf b | Node a (FooTree a b) a (FooTree a b)
will handle things only a little less neatly than the use of
wrappers, and will allow you to use type inference in much the
way you wish. What do you think? Cheers, -- P
You're right! That does solve the problem as I have stated it.
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.
Well, I'll manage to hack around it somehow. Thanks for helping!
--Guy