<p>You can find <code>Week04.Monad</code> <a href="https://github.com/input-output-hk/plutus-pioneer-program/blob/main/code/week04/src/Week04/Monad.hs" rel="nofollow noreferrer">here</a>.</p>

CC BY-SA 4.0
2022-11-02T00:46:22.020Z
2022-11-02T00:46:22.020Z
Falcon Stakepool
<p>Doing Week 04 of cohort 3 Plutus Pioneers here.</p>
<p>In the repl inside the nix shell, inside ~/plutus/plutus-pioneer-program/code/week04</p>
<p>Watching PPP 030402 at 34:54 to about 39:59.</p>
<p>When I do</p>
<blockquote><pre>
:l src/Week04/Either.hs
</pre></blockquote>
I get
<blockquote><pre>
Prelude Data.Char Text.Read Week04.Either> import Week04.Either
Prelude Data.Char Text.Read Week04.Either> :l src/Week04/Either.hs
<p>: 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 Week04.Either&gt;
</pre></blockquote>
Oddly, I can directly import Week04.Monad in the repl</p>
<blockquote><pre>
Prelude Data.Char Text.Read Week04.Either> import Week04.Monad
Prelude Data.Char Text.Read Week04.Either Week04.Monad> :l src/Week04/Either.hs
<p>: 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 Week04.Either Week04.Monad&gt;
</pre></blockquote>
and Week04.Monad IS part of the plutus-pioneer-program-week04.cabal file</p>
<blockquote><pre>
library
  hs-source-dirs:      src
  exposed-modules:     Week04.Contract
                     , Week04.Either
                     , Week04.Homework
                     , Week04.Maybe
                     , Week04.Monad
                     , Week04.Trace
                     , Week04.Writer
  other-modules:       Week04.Vesting
  build-depends:       aeson
                     , base ^>=4.14.1.0
                     , containers
                     , data-default
                     , freer-extras
                     , playground-common
                     , plutus-contract
                     , plutus-ledger
                     , plutus-ledger-api
                     , plutus-ledger-constraints
                     , plutus-tx-plugin
                     , plutus-tx
                     , text
  default-language:    Haskell2010
</pre></blockquote>
but it is listed under "exposed-modules" rather than "other-modules". If I manually edit to put it under other-modules (and remove it from exposed-modules, and various combinations), and even if I exit (:q) and re-enter the repl, the error persists, and I cannot replicate what is being demonstrated in the video.
<p>Any guidance? Thanks.</p>

CC BY-SA 4.0
2022-02-04T18:01:06.750Z
Here: Prelude Data.Char Text.Read Week04.Either> import Week04.Either 
You don't need neither "import Wee04.Either" nor ":l src/Week04/Either.hs" because it is already loaded. (See left side of ">" )
kindofdev
CC BY-SA 4.0
2022-02-04T18:40:21.840Z
That doesn't seem to make any difference. If I leave the repl and re-enter, I can produce this: 

Prelude Week04.Contract> :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 Week04.Either> 

And shouldn't cabal/nix/Haskell handle an attempted double import painlessly?
XiTouch
CC BY-SA 4.0
2022-02-04T18:44:36.290Z
I see that "import Week04.Either" works, loading module Week04.Either. Why do you want do ":l src/Week04/Either.hs " ?
kindofdev
CC BY-SA 4.0
2022-02-04T21:40:21.350Z
Just wanted to add that I also receive that error even when I add Week04.Monad to other-modules. While it is annoying that the warning appears, you can still follow along with what Lars does in the video
Travis
CC BY-SA 4.0
2022-02-05T23:27:49.140Z
Yes, I see now that I can follow along even with the error, probably related to exiting and re-entering either the repl or my nix shell. Was getting errors with everything prior to that. As to adding "Week04.Either" vs ":l src/Week04/Either.hs" I think that has to do with my current directory, perhaps whether the module is compiled, and some ambiguity - do you (@kindofdev) mean "import ..." or ":l ..."?
XiTouch
CC BY-SA 4.0
2022-02-05T23:31:14.777Z
I meant that using import Week04.Either works
kindofdev
<plutus-pioneer-program><cabal>
Where is Week04.Monad?
# Where is Week04.Monad?

(Asked by: username_0 on 2022-02-04)

Doing Week 04 of cohort 3 Plutus Pioneers here.
In the repl inside the nix shell, inside ~/plutus/plutus-pioneer-program/code/week04
Watching PPP 030402 at 34:54 to about 39:59.
When I do

:l src/Week04/Either.hs

I get

Prelude Data.Char Text.Read Week04.Either> import Week04.Either
Prelude Data.Char Text.Read Week04.Either> :l src/Week04/Either.hs
: 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 Week04.Either>

Oddly, I can directly import Week04.Monad in the repl

Prelude Data.Char Text.Read Week04.Either> import Week04.Monad
Prelude Data.Char Text.Read Week04.Either Week04.Monad> :l src/Week04/Either.hs
: 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 Week04.Either Week04.Monad>

and Week04.Monad IS part of the plutus-pioneer-program-week04.cabal file

library
  hs-source-dirs:      src
  exposed-modules:     Week04.Contract
                     , Week04.Either
                     , Week04.Homework
                     , Week04.Maybe
                     , Week04.Monad
                     , Week04.Trace
                     , Week04.Writer
  other-modules:       Week04.Vesting
  build-depends:       aeson
                     , base ^>=4.14.1.0
                     , containers
                     , data-default
                     , freer-extras
                     , playground-common
                     , plutus-contract
                     , plutus-ledger
                     , plutus-ledger-api
                     , plutus-ledger-constraints
                     , plutus-tx-plugin
                     , plutus-tx
                     , text
  default-language:    Haskell2010

but it is listed under "exposed-modules" rather than "other-modules". If I manually edit to put it under other-modules (and remove it from exposed-modules, and various combinations), and even if I exit (:q) and re-enter the repl, the error persists, and I cannot replicate what is being demonstrated in the video.
Any guidance? Thanks.

**Tags:** plutus-pioneer-program, cabal
> **Comments:**
> **username_1**: Here: Prelude Data.Char Text.Read Week04.Either> import Week04.Either  You don't need neither "import Wee04.Either" nor ":l src/Week04/Either.hs" because it is already loaded. (See left side of ">" )  
> **username_0**: That doesn't seem to make any difference. If I leave the repl and re-enter, I can produce this:   Prelude Week04.Contract> :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 Week04.Either>   And shouldn't cabal/nix/Haskell handle an attempted double import painlessly?  
> **username_1**: I see that "import Week04.Either" works, loading module Week04.Either. Why do you want do ":l src/Week04/Either.hs " ?  
> **username_2**: Just wanted to add that I also receive that error even when I add Week04.Monad to other-modules. While it is annoying that the warning appears, you can still follow along with what Lars does in the video  
> **username_0**: Yes, I see now that I can follow along even with the error, probably related to exiting and re-entering either the repl or my nix shell. Was getting errors with everything prior to that. As to adding "Week04.Either" vs ":l src/Week04/Either.hs" I think that has to do with my current directory, perhaps whether the module is compiled, and some ambiguity - do you (@kindofdev) mean "import ..." or ":l ..."?  
> **username_1**: I meant that using import Week04.Either works  

---

## 1 answers

### Answer by username_3 on 2022-11-02. Score: 0

You can find `Week04.Monad` [here](https://github.com/input-output-hk/plutus-pioneer-program/blob/main/code/week04/src/Week04/Monad.hs).


---

