| From: Stephen J Bevan <[EMAIL PROTECTED]>
| Date: Fri, 27 Nov 92 12:07:04 GMT
|
|
| Is it possible to import a type and the derived "show" function for it
| without having to import all the type's constuctors? For example, in
| the following I attempt to import just Lexeme into Token as the
| internal details of Lexeme should not be known to Token :-
>module Lexeme(Lexeme) where
>data Lexeme = Symbol_Lexeme Symbol | Int_Lexeme | ...
> deriving(Eq,Text)
You should be able to export Lexeme as an abstract type, as above,
generating the interface file
>interface Lexeme where
>data Lexeme deriving(Eq,Text)
The importing scope should understand that Lexeme is an instance of Text.
Instance information is exported whenever either the type is
exported, whether abstractly or not.
Simon