Haddock version during build
Claus Reinke
claus.reinke at talk21.com
Mon Jun 16 08:55:13 EDT 2008
>> Haddock.Interface.Rename
>>
>> but all I want is basically the equivalent of Traversable's mapM method.
You don't know what you're missing, then!-) If gfoldl's type wasn't
too limited to permit type changes, such as (HsDoc Name) to
(HsDoc DocName), boilerplate functions like renameDoc could
be collapsed into a few lines each, describing only the interesting
cases. Or do you have newer sources already doing that?
> Ah, I see the problem, you change the type of a type variable during
> the traversal - so you have to have some notion of which values are
> bound to the type variable, and which are not. I'm pretty sure this is
> impossible with Uniplate, and have no idea about SYB.
If there is a way to do this, it is way too hard to find. I was surprised
by this limitation, but I now recall it has come up before, with the
conclusion that gfoldl's type is not quite general enough. It seems
a common enough problem that it should be fixed, after which SYB
would again be the default candidate for generic traversal support?
I'd very much like to see generic traversal support over GHC's
ASTs, and I had added the issue to GhcApiStatus here:
http://hackage.haskell.org/trac/ghc/wiki/GhcApiStatus
Should there be a ticket for this, or would you like to add your
requests and needs to that page, to help make that a priority?
On the subject of deriving instances, like Traversable,
have you considered porting your generator code from
Derive to TH? That way, you could even derive the
instances for binary releases, without access to the sources,
and without adding anything to make releases bigger.
Btw, I also tried to use standalone deriving for HsDoc and
Data/Typeable, from outside the ghc package, and it failed.
Claus
More information about the Cvs-libraries
mailing list