[Haskell-cafe] Deconstructing types

Louis Wasserman wasserman.louis at gmail.com
Tue Sep 8 13:06:02 EDT 2009


Sean,

The answer is, I'm working on a recently semi-released package called
TrieMap.

The objective of this package, building off of the work in this
paper<https://docs.google.com/Doc?docid=0AWuaUF8ZNTNDZHB3emdyaF8zMzNmZmtmcHo2Yw&hl=en>,
is to automatically derive the type of a generalized trie for any algebraic
type based on its algebraic representation.  (I am working on writing up my
methods for publication.)

Of course, if I could get automatic access to the mechanisms of a type's
constructors, I wouldn't even require users to describe the algebraic
representation of their type...

Louis Wasserman
wasserman.louis at gmail.com


On Tue, Sep 8, 2009 at 2:34 AM, Sean Leather <leather at cs.uu.nl> wrote:

>
>
>> I don't know a thing about SYB, Data.Data, or Data.Typeable, mostly
>> because I'm an efficiency fanatic.  Nevertheless, I'd like to know whether
>> or not there's a way to deconstruct a (mostly) arbitrary type, into tuples,
>> unions, etc. using this framework.  Any thoughts?
>>
>
> You can use the Template Haskell deriving in EMGM to get that structure
> pretty efficiently.
>
>   http://www.cs.uu.nl/wiki/GenericProgramming/EMGM
>   http://hackage.haskell.org/package/emgm
>
> The obligatory question is: why do you want it?
>
> Sean
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20090908/681443b9/attachment.html


More information about the Haskell-Cafe mailing list