Original-Via: uk.ac.nsf; Sat, 7 Dec 91 13:59:04 GMT
X-Comment1: #############################################################
X-Comment2: # uk.ac.glasgow.cs has changed to uk.ac.glasgow.dcs #
X-Comment3: # If this address does not work please ask your mail #
X-Comment4: # administrator to update your NRS & mailer tables. #
X-Comment5: #############################################################
Original-Sender: [EMAIL PROTECTED]


BTW, I hope that my previous message makes clear the answer to this
question.

main should have type PreludeIO.Dialogue (if the compilation system
enforces that).  That doesn't necessarily mean the type needs to be in
scope.  The example Lennart gives should be ok therefore.

Simon

PS Oh for a concrete syntax for original names...

| From: john peterson <[EMAIL PROTECTED]>
| Date: Fri, 25 Oct 91 14:36:54 EDT 
| 
| 
| 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