You have probably compiled the module before so that there are .o and .hi files lying around in the directory. When GHCi finds these, it will by default load the module in compiled mode which means that only the stuff exported from the module is in scope.
If you didn't include a module declaration, this will by default only be main, since the default module declaration is module Main (main) where. This is also where the Main name comes from.
You can tell that this is happening from the prompt. Normally, when loading a module it will look like this:
Prelude> :load Foo.hs
[1 of 1] Compiling Main ( Foo.hs, interpreted )
Ok, modules loaded: Main.
*Main>
The asterisk before Main means that the module is open in interpreted mode, and that everything in it is in scope, including stuff imported from other modules. However, if I had just compiled Foo.hs and then tried to load it into GHCi, I would instead see something like this:
Prelude> :load Foo.hs
Ok, modules loaded: Main.
Prelude Main>
You can force interpreted mode by prefixing the file name with an asterisk:
Prelude> :load *Foo.hs
[1 of 1] Compiling Main ( Foo.hs, interpreted )
Ok, modules loaded: Main.
*Main>
moduledeclaration, if there is one.module Main (main) whereand when compiled, nothing but themainfunction is accessible.