TypeRepMap is a heterogeneous data structure similar in its
essence to
Map with types as keys, where each value has the
type of its key. In addition to that, each value is wrapped in an
interpretation
f.
Here is an example of using
Maybe as an interpretation, with a
comparison to
Map:
Map String (Maybe String) TypeRepMap Maybe
--------------------------- ---------------------
"Int" -> Just "5" Int -> Just 5
"Bool" -> Just "True" Bool -> Just True
"Char" -> Nothing Char -> Nothing
The runtime representation of
TypeRepMap is an array, not a
tree. This makes
lookup significantly more efficient.