user5610: Update: I am more confused.
If you follow the sequence below, you see that I

attempt to load Either.hs, and get a missing module error
attempt to load Monad.hs, and get a "one module loaded" happy message
attempt again to load Either.hs, and again get a missing module error
attempt to import Week04.Monad, and get no error or happy message, but "Week04.Monad" joins other modules before my Prelude prompt. So it sure looks like Week04.Monad is fully available.
attempt to load Either.hs and continue to get a missing module message, even though that module has been imported and is in my prompt.

So, still totally confused. If the repl cannot locate a module that has been loaded and imported, how can this error message be made to go away? Or does it mean nothing?
Prelude Data.Char Text.Read Plutus.Trace.Emulator Data.Default> :l src/Week04/Either.hs

<no location info>: warning: [-Wmissing-home-modules]
    These modules are needed for compilation but not listed in your .cabal file's other-modules: 
        Week04.Monad
Ok, two modules loaded.
Prelude Data.Char Text.Read Plutus.Trace.Emulator Data.Default Week04.Either> :l src/Week04/Monad.hs
Ok, one module loaded.
Prelude Data.Char Text.Read Plutus.Trace.Emulator Data.Default Week04.Monad> :l src/Week04/Either.hs

<no location info>: warning: [-Wmissing-home-modules]
    These modules are needed for compilation but not listed in your .cabal file's other-modules: 
        Week04.Monad
Ok, two modules loaded.
Prelude Data.Char Text.Read Plutus.Trace.Emulator Data.Default Week04.Either> import Week04.Monad
Prelude Data.Char Text.Read Plutus.Trace.Emulator Data.Default Week04.Monad Week04.Either> :l src/Week04/Either.hs

<no location info>: warning: [-Wmissing-home-modules]
    These modules are needed for compilation but not listed in your .cabal file's other-modules: 
        Week04.Monad
Ok, two modules loaded.
Prelude Data.Char Text.Read Plutus.Trace.Emulator Data.Default Week04.Monad Week04.Either> 
Prelude Data.Char Text.Read Plutus.Trace.Emulator Data.Default Week04.Monad Week04.Either> 

======== Original Question ========
I'm pulling this from a comment thread on another question as it is getting long and merits a separate answer.
In the repl, typically if I enter (as an example)

:l src/Week04/Either.hs

I was getting an error (that is fixed and is not the question here). Another helpful Pioneer suggested doing

import Week04.Either

However, I get the following error with that

Prelude Data.Char Text.Read Plutus.Trace.Emulator Data.Default> import Week04.Either
<no location info>: error:
    Could not load module ‘Week04.Either’
    It is a member of the hidden package ‘plutus-pioneer-program-week04-0.1.0.0’.
    Perhaps you need to add ‘plutus-pioneer-program-week04’ to the build-depends in your .cabal file.
Prelude Data.Char Text.Read Plutus.Trace.Emulator Data.Default>

I suspect this is either a directory level problem or (more likely) a "compiled vs interpreted" issue but still new enough to be confused. Can anyone clarify exactly how such things should work?

user2477: There is at least two things contributing to the confusion here.


attempt to load Either.hs, and get a missing module error


You don't actually get a missing module error. You get a warning that Week04.Monad is "not listed in your .cabal file's other-modules". So it warns that you may have problems in the cabal-file but the repl compiles and loads the modules Week04.Monad and Week04.Either just fine. So you get Ok, two modules loaded.


attempt to load Monad.hs, and get a "one module loaded" happy message


Week04.Monad has no dependencies so it loads without warning.


attempt again to load Either.hs, and again get a missing module error


Nothing has changed here so this step is exactly the same as step 1 and you get exactly the same result. Why steps 1 and 3 are the same is explained in the description of the :load-command:

"All previously loaded modules, except package modules, are forgotten.
The new set of modules is known as the target set. Note that :load can
be used without any arguments to unload all the currently loaded
modules and bindings.".

The documentation can be found from GHCi commands
The main difference between :load and import is that :load sets the current context in the repl so that you can access the internals of the module that has been loaded as current context. With import you only get access to things that have been exported from the respective module.

5610: <p>Update: I am more confused.</p>
<p>If you follow the sequence below, you see that I</p>
<ol>
<li>attempt to load Either.hs, and get a missing module error</li>
<li>attempt to load Monad.hs, and get a &quot;one module loaded&quot; happy message</li>
<li>attempt again to load Either.hs, and again get a missing module error</li>
<li>attempt to import Week04.Monad, and get no error or happy message, but &quot;Week04.Monad&quot; joins other modules before my Prelude prompt. So it sure <em>looks</em> like Week04.Monad is fully available.</li>
<li>attempt to load Either.hs and continue to get a missing module message, even though that module has been imported and is in my prompt.</li>
</ol>
<p>So, still totally confused. If the repl cannot locate a module that has been loaded and imported, how can this error message be made to go away? Or does it mean nothing?</p>
<pre><code>Prelude Data.Char Text.Read Plutus.Trace.Emulator Data.Default&gt; :l src/Week04/Either.hs

&lt;no location info&gt;: warning: [-Wmissing-home-modules]
    These modules are needed for compilation but not listed in your .cabal file's other-modules: 
        Week04.Monad
Ok, two modules loaded.
Prelude Data.Char Text.Read Plutus.Trace.Emulator Data.Default Week04.Either&gt; :l src/Week04/Monad.hs
Ok, one module loaded.
Prelude Data.Char Text.Read Plutus.Trace.Emulator Data.Default Week04.Monad&gt; :l src/Week04/Either.hs

&lt;no location info&gt;: warning: [-Wmissing-home-modules]
    These modules are needed for compilation but not listed in your .cabal file's other-modules: 
        Week04.Monad
Ok, two modules loaded.
Prelude Data.Char Text.Read Plutus.Trace.Emulator Data.Default Week04.Either&gt; import Week04.Monad
Prelude Data.Char Text.Read Plutus.Trace.Emulator Data.Default Week04.Monad Week04.Either&gt; :l src/Week04/Either.hs

&lt;no location info&gt;: warning: [-Wmissing-home-modules]
    These modules are needed for compilation but not listed in your .cabal file's other-modules: 
        Week04.Monad
Ok, two modules loaded.
Prelude Data.Char Text.Read Plutus.Trace.Emulator Data.Default Week04.Monad Week04.Either&gt; 
Prelude Data.Char Text.Read Plutus.Trace.Emulator Data.Default Week04.Monad Week04.Either&gt; 
</code></pre>
<p>======== Original Question ========</p>
<p>I'm pulling this from a comment thread on another question as it is getting long and merits a separate answer.</p>
<p>In the repl, typically if I enter (as an example)</p>
<blockquote>
<p>:l src/Week04/Either.hs</p>
</blockquote>
<p>I was getting an error (that is fixed and is not the question here). Another helpful Pioneer suggested doing</p>
<blockquote>
<p>import Week04.Either</p>
</blockquote>
<p>However, I get the following error with that</p>
<blockquote><pre>
Prelude Data.Char Text.Read Plutus.Trace.Emulator Data.Default> import Week04.Either
<p>&lt;no location info&gt;: error:
    Could not load module ‘Week04.Either’
    It is a member of the hidden package ‘plutus-pioneer-program-week04-0.1.0.0’.
    Perhaps you need to add ‘plutus-pioneer-program-week04’ to the build-depends in your .cabal file.
Prelude Data.Char Text.Read Plutus.Trace.Emulator Data.Default&gt;
</pre></blockquote></p>
<p>I suspect this is either a directory level problem or (more likely) a &quot;compiled vs interpreted&quot; issue but still new enough to be confused. Can anyone clarify exactly how such things should work?</p>
 2477: <p>There is at least two things contributing to the confusion here.</p>
<blockquote>
<ol>
<li>attempt to load Either.hs, and get a missing module error</li>
</ol>
</blockquote>
<p>You don't actually get a missing module error. You get a warning that <code>Week04.Monad</code> is &quot;not listed in your .cabal file's other-modules&quot;. So it warns that you may have problems in the cabal-file but the repl compiles and loads the modules <code>Week04.Monad</code> and <code>Week04.Either</code> just fine. So you get <code>Ok, two modules loaded</code>.</p>
<blockquote>
<ol start="2">
<li>attempt to load Monad.hs, and get a &quot;one module loaded&quot; happy message</li>
</ol>
</blockquote>
<p><code>Week04.Monad</code> has no dependencies so it loads without warning.</p>
<blockquote>
<ol start="3">
<li>attempt again to load Either.hs, and again get a missing module error</li>
</ol>
</blockquote>
<p>Nothing has changed here so this step is exactly the same as step 1 and you get exactly the same result. Why steps 1 and 3 are the same is explained in the description of the <code>:load</code>-command:</p>
<blockquote>
<p>&quot;All previously loaded modules, except package modules, are forgotten.
The new set of modules is known as the target set. Note that :load can
be used without any arguments to unload all the currently loaded
modules and bindings.&quot;.</p>
</blockquote>
<p>The documentation can be found from <a href="https://downloads.haskell.org/%7Eghc/7.0.3/docs/html/users_guide/ghci-commands.html" rel="nofollow noreferrer">GHCi commands</a></p>
<p>The main difference between <code>:load</code> and <code>import</code> is that <code>:load</code> sets the current context in the repl so that you can access the internals of the module that has been loaded as current context. With <code>import</code> you only get access to things that have been exported from the respective module.</p>
