Haddock version during build

Neil Mitchell ndmitchell at gmail.com
Fri Jun 13 13:01:28 EDT 2008


Hi

A few points of clarification:

* If you want to use Derive generated instances, you don't need to
depend on Derive, since it can be used quite happily as a
preprocessor.

* I don't think the GHC syntax tree types derive Data/Typeable, but I
could be wrong. I would suggest that they should, if technically
possible.

* Uniplate works perfectly well on all data types that SYB can deal
with. It requires no extensions in the single type case, and very
gentle and simple MPTC's for multitype operations. Since this is
GHC-land, simple MPTC hardly even counts as an extension! In general,
Uniplate is at least as powerful as SYB, in terms of what types it can
operate over.

My suggestion would be:

1) Add deriving Data/Typeable to all the types inside GHC,
particularly the abstract syntax tree ones.

2) Use either SYB or Uniplate to operate over them. Uniplate will
probably lead to simpler and shorter code, but more complex
dependencies - unless you just want to grab a copy of Uniplate and
shove it in bundled. SYB will be a bit longer and more complex, but
probably not by a substantial amount - you'll still get all the
goodness that operating generically brings. I would suspect that using
Traversable is not as neat as either SYB or Uniplate.

Much as I hate to say it, in this particular case of complex
inter-dependencies, I'd probably just use SYB :-)

Thanks

Neil


More information about the Cvs-libraries mailing list