diff options
author | simonpj@microsoft.com <unknown> | 2006-08-15 12:34:02 +0000 |
---|---|---|
committer | simonpj@microsoft.com <unknown> | 2006-08-15 12:34:02 +0000 |
commit | dfcf88523ec5988fbcaa2cbf812cc5862ad621cf (patch) | |
tree | 667032ae758ea0854166f21cd2b8d243a7a068c6 /docs/users_guide/separate_compilation.xml | |
parent | 4bcaad0c0fc30984282ae40b802f48b2d9dc20bb (diff) | |
download | haskell-dfcf88523ec5988fbcaa2cbf812cc5862ad621cf.tar.gz |
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.
Diffstat (limited to 'docs/users_guide/separate_compilation.xml')
-rw-r--r-- | docs/users_guide/separate_compilation.xml | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/docs/users_guide/separate_compilation.xml b/docs/users_guide/separate_compilation.xml index c33ff2175b..696d687869 100644 --- a/docs/users_guide/separate_compilation.xml +++ b/docs/users_guide/separate_compilation.xml @@ -816,12 +816,14 @@ can be given abstractly, by omitting the '=' sign and everything that follows. <programlisting> data R (x :: * -> *) y </programlisting> +You cannot use <literal>deriving</literal> on a data type declaration; write in +<literal>instance</literal> declaration instead. </para></listitem> <listitem><para> Class declarations is exactly as in Haskell, except that you may not put -default method declarations. You can also omit all the class methods entirely. +default method declarations. You can also omit all the superclasses and class +methods entirely; but you must either omit them all or put them all in. </para></listitem> -<listitem><para> Do not include instance declarations. There is a complication to do with -how the dictionary functions are named. It may well work, but it's not a well-tested feature. +<listitem><para> You can include instance declarations just as in Haskell; but omit the "where" part. </para></listitem> </itemizedlist> </para> |