Re: Associativity of the generic representation of sum types

2011-09-22 Thread Bas van Dijk
2011/9/22 Bas van Dijk : > I will make an official ticket for this. Done: http://hackage.haskell.org/trac/ghc/ticket/5499 ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-us

Re: Associativity of the generic representation of sum types

2011-09-22 Thread Bas van Dijk
2011/9/22 Bas van Dijk : > I just discovered the predicate: > >  -- | Marks if this constructor is a record >  conIsRecord :: t c (f :: * -> *) a -> Bool > > I think this can solve my problem. I think I have solved the bug now using conIsRecord. This is the new implementation: https://github.com/

Re: Associativity of the generic representation of sum types

2011-09-22 Thread Bas van Dijk
2011/9/22 Bas van Dijk : > What would make all this much easier is if the meta-information of > constructors had a flag which indicated if it was a record or not. > Could this be added? I just discovered the predicate: -- | Marks if this constructor is a record conIsRecord :: t c (f :: * -> *

Re: Associativity of the generic representation of sum types

2011-09-22 Thread Bas van Dijk
Hi José, I have another related question: (Excuse me for the big email, I had trouble making it smaller) I discovered a bug in my code that converts a product into a JSON value. I would like to convert products without field selectors into Arrays (type Array = Vector Value) and products with fiel

Re: Associativity of the generic representation of sum types

2011-09-22 Thread Bas van Dijk
2011/9/22 José Pedro Magalhães : > Hi Bas, > > On Thu, Sep 22, 2011 at 03:55, Bas van Dijk wrote: >> >> Hello, >> >> I just used the new GHC generics together with the DefaultSignatures >> extension to provide a default generic implementation for toJSON and >> parseJSON in the aeson package: >> >>