1

I am trying to build Future.hs from plutus-use-case from scratch. I take two files from plutus-starter: cabal.project as is, and plutus-starter.cabal that I have to edit according to the imports in Future.hs. I get however these errors when I run cabal build:

src/Plutus/Contracts/Future.hs:574:8: error:
    Illegal symbol `forall' in type
    Perhaps you intended to use RankNTypes or a similar language
    extension to enable explicit-forall syntax: forall <tvs>. <type>

I also had to add several other modules e.g. Plutus.Contracts.Currency and for every .hs file with forall, do I have to add {-# LANGUAGE RankNTypes #-}?

1

Yes, the LANGUAGE pragmas are required, best practice is probably following Plutus code examples and having separate pragmas per-file as needed.

It is also possible to allow some extensions globally via .cabal file by using default-extensions, e.g.:

library
 default-extensions:
   DataKinds
   RankNTypes

but this should be done with care and can bite later as some extensions are not compatible.

Also instead of adding files locally, try adding plutus-use-cases to the list of your dependencies, then you can import Plutus.Contracts.Currency.

1
  • I never thought of adding plutus-use-cases thats helpful!
    – Hud
    Aug 5 at 15:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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