Merging polykinded typeable
José Pedro Magalhães
jpm at cs.uu.nl
Fri Feb 8 10:58:58 CET 2013
I think the polykinded stuff is now ready to merge. A few issues remain:
1) dynamic004 fails when run without optimisation (it times out). This is
worrying. It's doing a comparison of the typeReps of nested lists, up to
lists. This worked fine before with -O0, but not anymore. With -O1 it works
Hopefully it's ok to just run this test with optimisation only, and assume
that no one should
expect great performance of Typeable on huge types with -O0...
2) With -XAutoDeriveTypeable, if you also derive Typeable instances in the
get a "duplicate instances" error. I think you'd rather have this be a
warning, so that the
semantics if -XAutoDeriveTypeable would be "derive Typeable for
types/classes for which
Typeable is not yet derived", instead of "derive Typeable for all
types/classes declared". But
I found this a bit tricky to check for, and as such haven't implemented it
yet. I can point you
to the place in the code where this is happening.
3) I don't know where to put `data Proxy t = Proxy`. I kind of need it for
defining things in
the library, but it doesn't need to be exported to the user, as we now have
`typeRep :: forall proxy. proxy a -> TypeRep`. I do export it from
because I want to use it in Data.Typeable, but I don't re-export it from
This is, in principle, all fine, but I think that the Proxy datatype is so
it should probably be defined in GHC somewhere, so that it doesn't start
showing up repeated
in all sorts of libraries. Perhaps we can just put it in GHC.Exts?
Either way, I'd like to merge this to the master branch now, and deal with
above after that. This is because it's tiresome to keep my branch
master, and I don't think the remaining issues are blocking, or will affect
of the master branch.
Regarding documentation, I've updated the user's guide to mention the new
behaviour of Typeable,
the fact that you can't define instances by hand, and the new flags
and -fwarn-typeable-instances). I've written a blog post in the past about
the new features
write another one about how to make sure your old Typeable code works in
the new version.
If you want to have a look at the code before merging, let me know, and
I'll update the
new-typeable branch. (I've stopped working on that branch, and now I have a
ready for merging with a single commit to master).
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the ghc-devs