I am trying to compile the Homework01.hs The build locally on Linux passes when I do :l src/Week02/Homework1.hs

Prelude PlutusTx Ledger.Scripts> :l src/Week02/Homework1.hs
[1 of 1] Compiling Week02.Homework1 ( src/Week02/Homework1.hs, /home/xxx/plutus-pioneer-program/code/week02/dist-newstyle/build/x86_64-linux/ghc- )
Ok, one module loaded.
Prelude PlutusTx Ledger.Scripts Week02.Homework1>

But when pasting the code in playground, I see an error : enter image description here

Is this a playground problem or am I doing something wrong in Haskell ?

Just fyi, it does compile successfully in playground with the skeleton code initially provided by Lars at github.

The error description in playground doesn't help.

2 Answers 2


Copy paste the whole file and just delete the line with

module Week02.Homework1 where

The playground does not need a module declaration (i guess it declares its own)


You need to remove the module export lines. That's not valid Plutus code but is useful for testing in a repl.

Your Answer

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

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