[Hs-Generics] Re: Scrap your boilerplate and Variants
Ralf Lammel
Ralf.Lammel at microsoft.com
Wed Oct 25 14:09:28 EDT 2006
It is certainly true that we start to have various SYB variants that the numbering scheme becomes clumsy :-) So it is actually good that some of the Bonn/Oxford work nicely uses qualifiers like revolutions etc. :-)
I do agree with Bruno that some of the SYB flavors are so much different that they need to be characterized more or less separately.
Oleg's flavor shouldn't have any fundamental issues with everywhere as far as I can see. (Bruno? Oleg?) I am only alerted by the fact that this flavor uses type codes to pass around functions (this is at least what I see in the initial email Oleg sent to me and SPJ after ICFP 2005).
Best,
Ralf
> -----Original Message-----
> From: generics-bounces at haskell.org [mailto:generics-bounces at haskell.org]
> On Behalf Of Bruno Oliveira
> Sent: Wednesday, October 25, 2006 5:37 AM
> To: oleg at pobox.com
> Cc: generics at haskell.org
> Subject: Re: [Hs-Generics] Re: Scrap your boilerplate and Variants
>
> Hello Oleg,
>
> >I have just committed the code for the alternative formulation of
> >SYB3. It requires neither higher-rank types nor mutually recursive
> >instances. Therefore, the code works even in Hugs (the original SYB3
> >code does not work in Hugs). The files are in the directory
> >SYB31/. The `final' code is dat2.hs (dat1.hs is the `intermediate'
> >step, which makes it easy to understand `dat2.hs'). The code has
> >comments that describe which part of the code is the `Library', which
> >part of the code is the `generic function' (independent of the data
> >structure), and which part of the code overrides some general
> >processing of the generic function. The code has two examples; one of
> >them is gsize, from the original SYB3 paper.
>
> >I'd like to suggest two corrections to the SyB page:
> > first, rank-2 types are not necessarily required for all
> >flavors of SYB
>
> > second, the original SYB3 imposes one more requirement:
> >mutually recursive instances. It is rarely mentioned -- but not
> >universally implemented (Hugs does not have it). SYB31 shows that one
> >can get by without that requirement. At the ICFP05 talk, Simon
> >Peyton-Jones asserted that recursive instances are essential. I have
> >publicly expressed doubts. Simon Peyton-Jones said: if you think
> >otherwise, show me the code. And so I did.
>
> I think we need to define first what do we consider by an SyB-like
> approach.
> I see that Ralf Lammel does not entirely agree that your code addressed
> exactly the same problems because, as I understand it, you miss the
> combinators
> like `everywhere` and `everything`.
>
> However, and also as Ralf Lammel points out your library may still be
> useful. I guess
> the question here is if this should be considered a variant of SyB.
>
> Perhaps we can settle this question by imposing that variants need to
> define
> `everywhere` and `everithing` combinators (or mechanism that achieve the
> same with
> the same amount of work)?
>
> Even if in the end we decide that this is a different approach altogether,
> we can
> discuss it as a different proposal.
>
> Cheers,
>
> Bruno Oliveira
>
>
> _______________________________________________
> Generics mailing list
> Generics at haskell.org
> http://www.haskell.org/mailman/listinfo/generics
More information about the Generics
mailing list