Among other things, this supports new forms of generic programming, since the choice of shape type, as lists or trees, or perhaps arrays, can be deferred. My approach to generic programming is to use reflective meta-programming systems. Reflective, because we want to take those objects which cannot ordinarily be abstracted over, such as types, shapes, the structure of the inheritance hierarchy, etc. Meta-Programming, because such systems are the perfect substrate for the design of program generators, a strategy which has been widely used as an implementation mechansim for generic programs. Object-code with type.
Object code has structure.
It is possible to annalyze it, take it apart, etc. Object code templates should support the automatic alpha-renaming of bound variables. This is necessary to avoid name clashes, User controlled gensym is NOT enough. Patrik Jansson and I have developed an extension of Haskell that supports polytypic programming, and we have written a lot of examples of polytypic programs, for example for unification, term rewriting, parsing, etc., which can be found here on our web page. I have supervised a number of Ph.D. theses concerned with developing a relational theory of datatypes in which the laws are parameterised by a datatype.