Hi,
        I've got a query about exporting classes and instances from a module.
In the report (1.2beta) it says that a class and all its methods are exported
if either it is explicitly named in the export list, or implicitly exported
if the export list is omited. I don't understand what is supposed to happen
if you split the definition of a class and its instances into different
modules?

For example the class Num and its methods are defined and exported in
PreludeCore. When the report says that the methods are exported does it also
mean that the instances for Integer,Int, Float and Double are exported ??
I find this a problem when trying to understand the instance definitions in
PreludeRatio. Instance definitions for the class Num are defined for
(Ratio a) in PreludeRatio, but the export list does not mention them.
Has the closure rule of section 5.1.3 been met ? Or does this mean that
the export definition in PreludeCore covers this instance as well (which
seems rather non-intuitive)? If it does (and this is what I assume to be
correct, otherwise their would be no point in defining instances for Ratio
in PreludeRatio), then it implies that I cannot multiply define instances,
and choose which I use in the final program by selective importing/exporting.

Thanks..........

--
 ***************************************************************************
 *   Jonathan Hill                   *                                     *
 *   Centre for Parallel Computing   *   Internet : [EMAIL PROTECTED]    *
 *   Computer Science Department     *                                     *
 *   Queen Mary & Westfied College   *   Voice    : 071-975-5167 ex 3232   *
 *   London E1 4NS                   *                                     *
 ***************************************************************************

Reply via email to