Allow class and instance decls in hs-boot files
authorsimonpj@microsoft.com <unknown>
Tue, 15 Aug 2006 12:34:02 +0000 (12:34 +0000)
committersimonpj@microsoft.com <unknown>
Tue, 15 Aug 2006 12:34:02 +0000 (12:34 +0000)
commitdfcf88523ec5988fbcaa2cbf812cc5862ad621cf
tree667032ae758ea0854166f21cd2b8d243a7a068c6
parent4bcaad0c0fc30984282ae40b802f48b2d9dc20bb
Allow class and instance decls in hs-boot files

For some reason, in 6.5 the manual said you could put a class decl in
an interface file, but not an instance decl; whereas the implementation
was exactly the othe way round.

This patch makes it possible to put *both* class and instance decls
in an interface file.

I also did a bit of re-factoring; comparing the declarations in the
hs-boot and hs file is now done by converting to IfaceSyn, because we
have good comparison operations for IfaceSyn already implemented.
This fixed a bug that previously let through an inconsistent declaration
of a data type.

The remaining infelicity concerns "abstract" TyCons.  They are a bit
of a hack anyway; and Classes are not handled in the same way.  Need
to think about this, but I think it's probably ok as it stands.
compiler/iface/IfaceSyn.lhs
compiler/iface/TcIface.lhs
compiler/typecheck/TcRnDriver.lhs
compiler/typecheck/TcTyClsDecls.lhs
docs/users_guide/separate_compilation.xml