Re: [Haskell-cafe] GADTs and Scrap your Boilerplate

2010-05-18 Thread Oscar Finnsson
Hi, thanks for all the great feedback. > Your GADT encodes an existential datatype. The closest attempt to encode > existential types in (something like) SYB that I know of is in Section 5.3 of > Alexey's PhD thesis [1]. Having said that, he uses the spine view, which > makes the generic view

Re: [Haskell-cafe] GADTs and Scrap your Boilerplate

2010-05-16 Thread Ben Millwood
On Sun, May 16, 2010 at 2:34 AM, Tom Hawkins wrote: >> I got the GADT >> >> data DataBox where >>   DataBox :: (Show d, Eq d, Data d) => d -> DataBox >> > [snip] >> >> but I can't figure out how to implement gunfold for DataBox. >> >> The error message is >> >> Text/XML/Generic.hs:274:23: >>     A

Re: [Haskell-cafe] GADTs and Scrap your Boilerplate

2010-05-16 Thread José Pedro Magalhães
Hi Oscar, On Sat, May 15, 2010 at 22:19, Oscar Finnsson wrote: > > (...) > > I guess my questions are: > > 1. Is it possible to combine GADTs with Scrap your Boilerplate? > Your GADT encodes an existential datatype. The closest attempt to encode existential types in (something like) SYB that I k

Re: [Haskell-cafe] GADTs and Scrap your Boilerplate

2010-05-15 Thread Tom Hawkins
> I got the GADT > > data DataBox where >   DataBox :: (Show d, Eq d, Data d) => d -> DataBox > [snip] > > but I can't figure out how to implement gunfold for DataBox. > > The error message is > > Text/XML/Generic.hs:274:23: >     Ambiguous type variable `b' in the constraints: I had a similar dif