[Hs-Generics] Developing SYB, packaging issues

Simon Peyton-Jones simonpj at microsoft.com
Thu Aug 21 12:41:24 EDT 2008


1) Where is the source code going to be hosted? Here in Utrecht we currently have a repository with several (cabalized) generic programming libraries, SYB included. But maybe SYB will stay in the same repository as GHC?

I don't think it matters too much where it's hosted.  For us it might be convenient if it was on darcs.haskell.org<http://darcs.haskell.org> because it reduces the number of ways in which you can get stuck.  But servers are fairly reliable so this probably isn't very important.

We might prefer to keep it in an SVN repository where we have other generic libraries, if that is not a big problem. If it is, it can always go to darcs.haskell.org<http://darcs.haskell.org> anyway.

I think we would very much prefer NOT to use SVN.  We're already using darcs, and will shortly be using Git too.  To have SVN too is a situation we'd like to avoid.  Darcs or Git please!

3) How does the separation affect the automatic instance deriving mechanism?

It think it'd make sense for the classes Data and Typable themselves to remain in a "core package", precisely because the deriving mechanism generates code for them.  If you change the method signatures, the code has to change, for example.  But all the library code layered on top can be in the SYB package.

Ok, that makes sense. Only any changes to methods in Data would need to wait for a new version of GHC. But those should be kept to a minimum, if any at all. It's just a pity that so many methods are inside the Data class (like gmapQ and friends). But then again, there is a reason for them to be there, and it's probably not a good idea to change those anyway. Most development should proceed by adding new things on top of the existing Data class core.

What about instances of Data for the base types? Here I see a few possibilities:
1) No types have instances in core. Those could be in the SYB package, or the user could use stand-alone deriving to get them (if that is possible).
2) All types have instances in core, similar to the current Data.Generics.Instances situation. This implies that the situation discussed in [1] (inconvenient Data instances) will remain.
3) Something between the previous two, such as the 'standard' Data instances staying in core, and the others going to the SYB package (where they could be thought over, or separated into another module which is not imported by default).

I suspect it'd be better to have all the instances in the SYB package.  If there are data types whose instances are sufficiently simple and unlikely to change that they can live in the same module as the Data class itself, then we can do that, but otherwise just put them in the package.

S



Pedro

[1] http://www.haskell.org/pipermail/generics/2008-June/000347.html
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/generics/attachments/20080821/28d43f96/attachment-0001.htm


More information about the Generics mailing list