[Haskell-cafe] Reading open data types
benja.fallenstein at gmail.com
Wed Jun 13 18:16:56 EDT 2007
2007/6/14, Stefan O'Rear <stefanor at cox.net>:
> 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.
More information about the Haskell-Cafe