
On Sun, 19 Jan 2003 12:50:16 -0600
Jon Cast
Short version: if Typeable is a super-class of Visible or mentioned in your existential type (i.e., forall a. (Visible a, Typeable a) => Con) you can use (fromDynamic . toDyn) to safely (attempt to) convert the abstract type into the concrete one. If that last paragraph wasn't coherent, I can try to explain it more.
Ok, this is clear. I am still not sure of how to decide the type to give to the "extracted" object. In the graphical interface, any object should have a menu saying on its top row: "Text file" or "Applet" (depending from the type of the object) and then a list of operations. This should happen even when the object is inside the panel-list, (so maybe a panel would be a list of untyped "objects" with an attribute of type [Operation]). But, to fully exploit the power of a "functionally-programmed" desktop, the interface should allow the user to map an operation onto all the objects of the panel; in this case the allowed operations should be those that all the object share. This is what I think, however I can't realize the connection between the haskell type system and what I wish to have. Can someone lead me to a clearer vision of the topic? Vincenzo -- First they ignore you, then they laugh at you, then they fight you, then you win. [Gandhi]