Makarius wrote:
On Wed, 16 Sep 2009, Makarius wrote:
On Wed, 16 Sep 2009, David Matthews wrote:
To be honest, when I think of an abstract type I think of the abstype construction rather than opaque signature matching.
Interestingly, opaque signature matching also causes problems in SML/NJ pretty printing. I consider to make another attempt at abstype within a non-opaque structure, trying to avoid the nested structure within the abstract type.
After looking at this again, I've found that all problems disappear if SML97's opaque matching is eliminated. With plain old abstype and SML90's signature matching, pretty printing works again as expected.
If you're only installing the pretty printer once it should be all right if you install the pretty printer inside the structure and then apply an opaque signature constraint to the result. The pretty printer will be inherited by the type in the opaque signature. This was what was intended by the section in the FAQ.
If you need to change the pretty printer it's more difficult with an opaque signature. If there's the possibility of an internal pretty printer leaking out through exceptions then you need to install the pretty printer both for the internal type and for the external type.
As you say, these problems don't arise with abstypes and transparent matching. I've updated the FAQ as a result of your comments.
David