
Yo, 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? Louis Wasserman wasserman.louis@gmail.com

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

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
paperhttps://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@gmail.com
On Tue, Sep 8, 2009 at 2:34 AM, Sean Leather
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

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 paperhttps://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...
Well, it's relatively easy to use Template Haskell to determine the structure of a datatype. Look in the "Generics" category on Hackage for a number of examples (e.g. emgm, regular, multirec) or see if the Derive package will do it for you. According to Neil Mitchell, you just need one example: http://www.cogsys.wiai.uni-bamberg.de/aaip09/aaip09_submissions/talk_mitchel... I don't know if it's easy or even possible to capture a sum-of-products view from SYB. Sean

Oh, geezzzzz. Wrong link. I meant
http://portal.acm.org/citation.cfm?id=967471 .
Louis Wasserman
wasserman.louis@gmail.com
On Tue, Sep 8, 2009 at 1:06 PM, Louis Wasserman
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 paperhttps://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@gmail.com
On Tue, Sep 8, 2009 at 2:34 AM, Sean Leather
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

Hello Louis,
On Tue, Sep 8, 2009 at 19:06, Louis Wasserman
Sean,
The answer is, I'm working on a recently semi-released package called TrieMap.
Is that similar to what is done in [1]? A draft paper [2] also refers that implementation. Cheers, Pedro [1] http://www.haskell.org/haskellwiki/GHC/Indexed_types#An_associated_data_type... [2] http://www.cse.unsw.edu.au/~chak/project/generics/

The goal is similar, but I'm attempting to automatically infer the
appropriate map type for any algebraic datatype -- and while I'm at it, the
TrieMap package aims to include all the methods Data.Map offers.
Louis Wasserman
wasserman.louis@gmail.com
2009/9/9 José Pedro Magalhães
Hello Louis,
On Tue, Sep 8, 2009 at 19:06, Louis Wasserman
wrote: Sean,
The answer is, I'm working on a recently semi-released package called TrieMap.
Is that similar to what is done in [1]? A draft paper [2] also refers that implementation.
Cheers, Pedro
[1] http://www.haskell.org/haskellwiki/GHC/Indexed_types#An_associated_data_type... [2] http://www.cse.unsw.edu.au/~chak/project/generics/

The goal is similar, but I'm attempting to automatically infer the appropriate map type for any algebraic datatype -- and while I'm at it, the TrieMap package aims to include all the methods Data.Map offers.
Perhaps you want to read about the type-indexed tries in "Generic Haskell: Applications": http://www.cs.uu.nl/~johanj/publications/ghpractice.pdf Sean

This is about the same as the other paper I linked to, I think, but I'm
interested in actually connecting the fully general trie construction to
Template Haskell and other facilities to reduce the coder's overhead of
using these tries in practice to a minimum.
Louis Wasserman
wasserman.louis@gmail.com
On Wed, Sep 9, 2009 at 10:24 AM, Sean Leather
The goal is similar, but I'm attempting to automatically infer the
appropriate map type for any algebraic datatype -- and while I'm at it, the TrieMap package aims to include all the methods Data.Map offers.
Perhaps you want to read about the type-indexed tries in "Generic Haskell: Applications": http://www.cs.uu.nl/~johanj/publications/ghpractice.pdf
Sean
participants (3)
-
José Pedro Magalhães
-
Louis Wasserman
-
Sean Leather