1

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.

6
  • 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
    Feb 4, 2022 at 18:01
  • 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
    Feb 4, 2022 at 18:40
  • I see that "import Week04.Either" works, loading module Week04.Either. Why do you want do ":l src/Week04/Either.hs " ?
    – kindofdev
    Feb 4, 2022 at 18:44
  • 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
    Feb 4, 2022 at 21:40
  • 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
    Feb 5, 2022 at 23:27

1 Answer 1

0

You can find Week04.Monad here.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.