Easily generating efficient instances for classes
ndmitchell at gmail.com
Tue Mar 2 08:30:12 EST 2010
Derive generates declarations - they can be instances, classes, data
types, functions, type synonyms etc.
On Mon, Mar 1, 2010 at 10:32 AM, John Lato <jwlato at gmail.com> wrote:
>> From: Christian H?ner zu Siederdissen
>> I am thinking about how to easily generate instances for a class. Each
>> instance is a tuple with 1 or more elements. In addition there is a
>> second tuple with the same number of elements but different type. This
>> means getting longer and longer chains of something like (...,x3*x2,x2,0).
>> - template haskell?
>> - CPP and macros?
>> Consider arrays with fast access like Data.Vector, but with higher
>> dimensionality. Basically, I want (!) to fuse when used in Data.Vector
> (shameless plug) You may want to look at my AdaptiveTuple package,
> which does something very similar to this. I used Template Haskell
> because AFAIK neither generic approaches nor DrIFT/Derive will
> generate data decls.
> If all you need are the instances, then DrIFT or Derive would be my
> Glasgow-haskell-users mailing list
> Glasgow-haskell-users at haskell.org
More information about the Glasgow-haskell-users