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?