Original-Via: uk.ac.nsf; Fri, 25 Oct 91 23:30:48 BST
Original-Sender: [EMAIL PROTECTED]

Lennart asks:

>      import Prelude hiding(Dialogue)
>      main _ = error "main"
>
> ... I quote from the Report (p. 40, line 8):
>
>        ..., and main must have type Dialogue.
>
>As far as I can understand that means that the compiler must check this
>during type checking, but what if Dialogue is hidden?

A direct answer to this questions would be that, as in the derived
instances, Dialogue in this case refers to the definition in the
Prelude regardless of local hidings and renamings.  This really isn't
that big of a deal - it just requires the compiler to be able to
directly grab a name from the Prelude during the type check.

As a side issue, note that the `module Main, value main' issue is not
directly a part of the standard - note the `by convention' earlier in
the paragraph.  There is no formal requirement than `main' be treated
specially in the language, although an implementation may choose to do so.

Finally, there is the issue of whether the types and synonyms used by
the IO system should be placed in the core.  I don't think there is
any pressing reason to do this - in general, I feel the core should be
as small as possible.  Our experience is that in situations like these
the compiler can simply look for names directly in the Prelude instead
of the local namespace.  Maybe Joe can say something about this.

  John


Reply via email to