"Ambiguous occurrence 'main'" error
This two file program,
module T where
main = undefined
module Main where
import T
main = putStrLn "Hello world!"
is observed (with 8.4.3, 8.6.3 and HEAD
) to give rise to this error:
Main.hs:1:1: error:
Ambiguous occurrence ‘main’
It could refer to either ‘T.main’,
imported from ‘T’ at Main.hs:2:1-8
(and originally defined at T.hs:2:1-4)
or ‘Main.main’, defined at Main.hs:3:1
It seems there is not actual ambiguity given this statement from the Haskell 2010 Language Report: "If the export list is omitted, all values, types and classes defined in the module are exported, but not those that are imported."