This time, "Once, Weakly" gets systematic. We've gathered together most
of our compile time type manipulation techniques to make a start at a
unified framework for the manipulation of types at compile time.
We discuss design of a framework for the dismantling of an arbitrary
type into its component parts, and its later regeneration for the
purpose of compile time type manipulation. We also show how to extend
the framework to include arbitrarily fine detail on type-related
information. We then show how some simple pattern matching and
substitution and replacement can be performed on a dismantled type
before a normal type is regenerated from it.
In effect, we now have two equivalent, but structurally distinct,
versions of the same type. The normal version is optimized for use in a
traditional fashion: accessing its operations, causing code to be
generated that will execute at runtime, etc. The dismantled version is
optimized for compile time analysis and manipulation. Therefore, we now
have the ability to move an arbitrary type between representations
according to how we want to use it. The invertibility of the
representations assures us that either representation will contain all
the information present in the other.
See http://www.semantics.org/weekly.html
The source code for the framework is available at
http://www.semantics.org/code.html
Best regards,
Steve