
13 Jun
2007
13 Jun
'07
10:16 p.m.
2007/6/14, Stefan O'Rear
On Wed, Jun 13, 2007 at 05:12:25PM +0300, Benja Fallenstein wrote:
However, this is still kind of boring. Is there a better way? If not, would it be a good idea to have compiler support for building this kind of type table?
The compiler does build exactly such a table - it's called a symbol table. If you aren't afraid of massive overkill, you can use hs-plugins to write String -> exists a. Read a => a .
Now *there* is an idea. :-) Hah. Massive overkill, indeed, but you'd call 'eval' only once for every type tag, of course, and cache the result, so the overhead would be O(1) per run of the application. - Benja