Hello,

The main point about the error message is that it says that 'main' is
not defined, while it is typechecking 'main' - but I thought it only
typechecks things which are defined? So that makes me think that the
type is somehow wrong, it is a red herring. It would be better not to
say anything about types if they are irrelevant. Also it might be
useful if GHC could say where it is getting this information that
'main' is not defined - clearly not from the source - maybe from a
previous .o file? .hi file? Could it happen if I've recompiled a
package that my program depends on?

Thanks,

Frederik

On Sun, May 13, 2007 at 05:05:49PM +0100, Simon Peyton-Jones wrote:
> That's odd.  The file 'bayesian-sets.hs' starts by saying
>         module Main where
> and it certainly defines the function 'main'.  I can't see why GHC would 
> report that it's not defined.
> 
> It's hard to help, since you say it's not reproducible.
> 
> As to the wording of the error message.  Haskell requires that the module 
> 'Main' defines a function called 'main'.  The error message is trying to say 
> that you have disobeyed this rule.  (Apparently wrongly in this case.)
> 
> You say that the wording is not human-friendly, and by definition you are 
> right (you found it confusing).  Can you suggest a more human-friendly way to 
> say that you have failed to define 'main' in module 'Main'?
> 
> Thanks
> 
> Simon
> 
> | -----Original Message-----
> | From: [EMAIL PROTECTED] [mailto:glasgow-haskell-
> | [EMAIL PROTECTED] On Behalf Of Frederik Eaton
> | Sent: 12 May 2007 22:14
> | To: glasgow-haskell-bugs@haskell.org
> | Subject: main main main main main
> |
> | Hello,
> |
> | I'm suddenly getting the following error when I compile a program:
> |
> | bayesian-sets.hs:1:0:
> |     The main function `main' is not defined in module `Main'
> |     When checking the type of the main function `main'
> |
> | I don't know what that means. Perhaps the error could be made more
> | human-friendly? Here is the output of 'ghc -v':
> |
> | [1]$ ghc -v --make $A.hs -package vectro -lstdc++ -fallow-incoherent-
> | instances
> | Glasgow Haskell Compiler, Version 6.6.20070420, for Haskell 98, compiled
> | by GHC version 6.6.20070420
> | Using package config file: /home/frederik/arch/i386//lib/ghc-
> | 6.6.20070420/package.conf
> | Using package config file: /home/frederik/.ghc/i386-linux-
> | 6.6.20070420/package.conf
> | wired-in package base mapped to base-2.0
> | wired-in package rts mapped to rts-1.0
> | wired-in package haskell98 mapped to haskell98-1.0
> | wired-in package template-haskell mapped to template-haskell-2.0
> | Hsc static flags: -static
> | *** Chasing dependencies:
> | Chasing modules from: bayesian-sets.hs
> | Stable obj: []
> | Stable BCO: []
> | compile: input file bayesian-sets.hs
> | Created temporary directory: /tmp/ghc8785_0
> | *** Checking old interface for main:Main:
> | [1 of 1] Compiling Main             ( bayesian-sets.hs, bayesian-sets.o )
> | *** Parser:
> | *** Renamer/typechecker:
> |
> | bayesian-sets.hs:1:0:
> |     The main function `main' is not defined in module `Main'
> |     When checking the type of the main function `main'
> | *** Deleting temp files:
> | Deleting: /tmp/ghc8785_0/ghc8785_0.s
> | Warning: deleting non-existent /tmp/ghc8785_0/ghc8785_0.s
> | Upsweep partially successful.
> | *** Deleting temp files:
> | Deleting:
> | link(batch): upsweep (partially) failed OR
> |    Main.main not exported; not linking.
> | *** Deleting temp files:
> | Deleting:
> | *** Deleting temp dirs:
> | Deleting: /tmp/ghc8785_0
> |
> | Thanks,
> |
> | Frederik
> |
> | --
> | http://ofb.net/~frederik/
> 

-- 
http://ofb.net/~frederik/
_______________________________________________
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to